diff --git a/manuals/ta_iom.md b/manuals/ta_iom.md deleted file mode 100644 index 7d6d9c7..0000000 --- a/manuals/ta_iom.md +++ /dev/null @@ -1,85 +0,0 @@ -# Techage/Beduino I/O Module - -I/O modules support the following functions: - -### event - -Every signal that is sent to an I/O module triggers an event on the controller. -Events can be queried using the `event()` function. -If the function returns the value `1`, one or more signals have been received. -Calling `event()` resets the event flag. - -```c -event() -``` - -### read - -Read a value from a remote techage block. - -- *port* is the I/O module port number -- *cmnd* is the command, like `IO_STATE` (see example code "ta_cmnd.c") - -```c -read(port, cmnd) -``` - -### send_cmnd - -Send a command to a techage block (see [commands](https://github.com/joe7575/beduino/blob/main/BEPs/bep-005_ta_cmnd.md)). - -- *port* is the I/O module port number -- *topic* is a number from the list of [Beduino commands](https://github.com/joe7575/beduino/blob/main/BEPs/bep-005_ta_cmnd.md) -- *payload* is an array or a string with additional information, depending on the command. If no additional commands are required, "" can be used. - -```c -send_cmnd(port, topic, payload) -``` - -### request_data - -Request information from a techage block (see [commands](https://github.com/joe7575/beduino/blob/main/BEPs/bep-005_ta_cmnd.md)). - -- *port* is the I/O module port number -- *topic* is a number from the list of [Beduino commands](https://github.com/joe7575/beduino/blob/main/BEPs/bep-005_ta_cmnd.md) -- *payload* is an array or a string with additional information, depending on the command. If no additional commands are required, "" can be used. -- *resp* is an array for the response data. The array must be defined large enough to hold the response data. - -```c -request_data(port, topic, payload, resp) -``` - -## Functions for TA4 Display and TA4 Display XL - -### clear_screen - -Clear the display. - -- *port* is the I/O module port number - -```c -clear_screen(port) -``` - -### append_line - -Add a new line to the display. -- *port* is the I/O module port number -- *text* is the text for one line - -```c -append_line(port, text) -``` - - -### write_line - -Overwrite a text line with the given string. - -- *port* is the I/O module port number -- *row* ist the display line/row (1-5) -- *text* is the text for one line - -```c -write_line(port, row, text) -``` diff --git a/move_controller/soundblock.lua b/move_controller/soundblock.lua index bafcbb2..7743f0f 100644 --- a/move_controller/soundblock.lua +++ b/move_controller/soundblock.lua @@ -116,8 +116,9 @@ techage.register_node({"techage:ta3_soundblock"}, { end end, on_beduino_receive_cmnd = function(pos, src, topic, payload) + print("ta3_soundblock", topic, payload[1], payload[2]) if topic == 1 then - if payload[1] == 0 then + if payload[1] == 1 then play_predefined_sound(pos) return 0 end