1#!/bin/sh2# Connects to localhost:4223 by default, use --host and --port to change this34uid=XYZ# Change XYZ to the UID of your RGB LED Button Bricklet56# Get current button state7tinkerforgecallrgb-led-button-bricklet$uidget-button-state
1#!/bin/sh2# Connects to localhost:4223 by default, use --host and --port to change this34uid=XYZ# Change XYZ to the UID of your RGB LED Button Bricklet56# Set light blue color7tinkerforgecallrgb-led-button-bricklet$uidset-color0170234
1#!/bin/sh 2# Connects to localhost:4223 by default, use --host and --port to change this 3 4uid=XYZ# Change XYZ to the UID of your RGB LED Button Bricklet 5 6# Handle incoming button state changed callbacks 7tinkerforgedispatchrgb-led-button-bricklet$uidbutton-state-changed& 8 9echo"Press key to exit";readdummy
1011kill---$$# Stop callback dispatch in background
The <function> to be called can take different options depending of its
kind. All functions can take the following options:
--help shows help for the specific function and exits
Getter functions can take the following options:
--execute<command> shell command line to execute for each incoming
response (see section about output formatting
for details)
Setter functions can take the following options:
--expect-response requests response and waits for it
The --expect-response option for setter functions allows to detect
timeouts and other error conditions calls of setters as well. The device will
then send a response for this purpose. If this option is not given for a
setter function then no response is sent and errors are silently ignored,
because they cannot be detected.
<config> – Type: Int, Range: See symbols, Default: 3
Output:
no output
Sets the status LED configuration. By default the LED shows
communication traffic between Brick and Bricklet, it flickers once
for every 10 received data packets.
You can also turn the LED permanently on/off or show a heartbeat.
If the Bricklet is in bootloader mode, the LED is will show heartbeat by default.
The following symbols are available for this function:
temperature – Type: Int, Unit: 1 °C, Range: [-215 to 215 - 1]
Returns the temperature as measured inside the microcontroller. The
value returned is not the ambient temperature!
The temperature is only proportional to the real temperature and it has bad
accuracy. Practically it is only useful as an indicator for
temperature changes.
Using callbacks for recurring events is always preferred
compared to using getters. It will use less USB bandwidth and the latency
will be a lot better, since there is no round trip time.
Internal functions are used for maintenance tasks such as flashing a new firmware
of changing the UID of a Bricklet. These task should be performed using
Brick Viewer instead of using the internal functions directly.
Sets the bootloader mode and returns the status after the requested
mode change was instigated.
You can change from bootloader mode to firmware mode and vice versa. A change
from bootloader mode to firmware mode will only take place if the entry function,
device identifier and CRC are present and correct.
This function is used by Brick Viewer during flashing. It should not be
necessary to call it in a normal user program.
The following symbols are available for this function:
Sets the firmware pointer for write-firmware. The pointer has
to be increased by chunks of size 64. The data is written to flash
every 4 chunks (which equals to one page of size 256).
This function is used by Brick Viewer during flashing. It should not be
necessary to call it in a normal user program.