IRIN Device parameter?

Tag16c

New Member
I searched the forum and did not find any post about this, sorry if I missed it.
I am not sure where this should be posted.
It would be nice if the IRIN command had a second input parameter DEVICE.
This would pair nicely with the IROUT command.
Code:
IRIN [timeout, address,] pin, [B][device],[/B]variable
Where the IRIN command reads all IR inputs but if the device variable is not requested the data is ignored if the device is not equal to 1. This would make the command backwards compatible, and make the command much more functional in comunicating with other Picaxes in a group.
for example the lsb of device could be used as msb for variable to get 0 - 255 as a data input and still allow 16 modules to talk to each other.
 

westaust55

Moderator
I searched the forum and did not find any post about this, sorry if I missed it.
I am not sure where this should be posted.
It would be nice if the IRIN command had a second input parameter DEVICE.
This would pair nicely with the IROUT command.
Code:
IRIN [timeout, address,] pin, [B][device],[/B]variable
Where the IRIN command reads all IR inputs but if the device variable is not requested the data is ignored if the device is not equal to 1. This would make the command backwards compatible, and make the command much more functional in comunicating with other Picaxes in a group.
for example the lsb of device could be used as msb for variable to get 0 - 255 as a data input and still allow 16 modules to talk to each other.

You have posted in the "Sandbox" area which, in general, is primarily for test purposes.

Suggest that you repost this and future posts into the Active Forum area at:
http://www.picaxeforum.co.uk/forumdisplay.php?f=2

You might also do well to read the sticky Read ME First post at the start of the active forum area about post formatting.
 

hippy

Ex-Staff (retired)
Staff member
[ Moved to Active Forum ]

All suggestions are welcomed and this may be something we consider for the future.

In the meantime it may be possible to achieve networked communications by sending and receiving with 'Device Code 1' and using multiple IROUT and IRIN transmissions. A command value with its bit6 set with bit0-bit5 indicating to which unit subsequent bytes with bit6 cleared are directed at. This would be similar to how MIDI and other serial transmission systems discriminate between commands / target and data.
 

Pfrogs

Member
You could easily do this with a "If..then" command after IROUT/IRIN and include the Device ID as a variable to be checked by that command.

Nonetheless, if you're looking for multiple IR communications at the same time, beware that the IR signals will interfer with each other and transmissions will be ruined (unless you use different frequencies, I guess).
 
Top