'named' hardware not working in messageport.
using this code - then selecting the appropriate device in the pull down options - as in - the mega2560, unit A - will not work.
.
Code: Select all
-- This function will be called when a message is received from the Arduino.
function new_message(id, payload)
print("received new message with id " .. id)
end
id = hw_message_port_add("My message port", new_message)
-- You can also send messages to the Arduino
-- In this case a message with id 777 with 3 bytes (0x01, 0x02, 0x03)
hw_message_port_send(id, 100, "BYTE[3]", { 1, 2, 3 })
.
Code: Select all
-- This function will be called when a message is received from the Arduino.
function new_message(id, payload)
print("received new message with id " .. id)
end
id = hw_message_port_add("ARDUINO_MEGA2560_A", new_message)
-- You can also send messages to the Arduino
-- In this case a message with id 777 with 3 bytes (0x01, 0x02, 0x03)
hw_message_port_send(id, 100, "BYTE[3]", { 1, 2, 3 })
.
.
Also, just for info, the code on the link here -
https://siminnovations.com/wiki/index.p ... e_port_add
is incorrect
The line -
Code: Select all
hw_message_port_send(id, 777, [ 1, 2, 3 ])
Code: Select all
hw_message_port_send ( id, 777, "BYTE[3]", { 1, 2, 3 } )
Thanks
Joe