Devices library
This page provides some extra devices. Sometimes based on electronic bricks devices but with more abilities.
Soft button
The soft button is an extension of the button brick device. It can detect click, double click and long press. Timers of double click and long press can be modified to fit your needs.
Messages
SoftButton > click()
: The button has been clicked.SoftButton > double_click()
: The button has been double clicked.SoftButton > long_press()
: The button has been long pressed.
Configuration
A simple example which use this device is available here.
Soft temperature sensor
The soft temperature sensor is an extension of the temperature sensor in brick devices. It provides in addition an alarm feature and keeps minimum and maximum.
Messages
SoftTemperatureSensor < get_temperature()
: Request the temperature.SoftTemperatureSensor < reset_min_max()
: Reset minimum and maximum.SoftTemperatureSensor < subscribe_temperature(interval: UInt16)
: Request the temperature everyinterval
milliseconds.SoftTemperatureSensor < unsubscribe_temperature()
: Stop the automatic requests.SoftTemperatureSensor > temperature(t: Int16, min: Int16, max: Int16)
: Sends current temperature, minimum and maximum.SoftTemperatureSensorAlarms < activate_alarms(low: Int16, high: Int16)
: Activate alarms withlow
as low value andhigh
as high value.SoftTemperatureSensorAlarms < desactivate_alarms()
: Desactivate alarms.SoftTemperatureSensorAlarms > low_temp_alarm(t: Int16)
: Sends the current temperature if the low value is reached.SoftTemperatureSensorAlarms > high_temp_alarm(t: Int16)
: Sends the current temperature if the high value is reached.SoftTemperatureSensorAlarms > no_alarm()
: The current temperature is between low and high levels.
Configuration
Serial
The serial device enables to read and write in the serial console to interfaced with the Arduino board.
Messages
Serial < print_byte(b : Byte)
: Write byte on the serial port.Serial < print_message(msg : String)
: Write string on the serial port.Serial < print_value(v : Int16)
: Write integer on the serial port.Serial > receive_byte(b : Byte)
: The characterb
has been read on the serial port.
Configuration
Advanced serial
The advanced serial device is the same as the serial device except that it has a value mode which enables to read value in the serial console.
Messages
AdvancedSerial < print_byte(b : Byte)
: Write byte on the serial port.AdvancedSerial < print_message(msg : String)
: Write string on the serial port.AdvancedSerial < print_value(v : Int16)
: Write integer on the serial port.AdvancedSerial < value_mode()
: Activate the value mode.AdvancedSerial > receive_byte(b : Byte)
:b
has been read on the serial port.AdvancedSerial > receive_value(v : Int16)
: The valuev
has been read on the serial port.
Configuration