I test with simple schematic, using SerialSoftware to use D2 and D3 pins:
I use info from Arduino Cookbook by Michael Margolis and extract info for use 2 Arduino boards, one as sender and second as receiver. Also first Arduino code the message before sending and second Arduino receive and decode the mesage.
First, I send 3 integer number as in original article using tx_1.ino for fixed numbers or tx_1a.ino for random numebers. For receiver I use rx_1.ino sketch.
I made Multiple Text Fields in Single Message using Arduino movie to see hwo system work.
For example, if temperature is +2.4 degree Celsius, state of sensor is 1 and procentage is 17%, first Arduino will send:
- first numeber is 24 (2.4*10)
- second number is 1, because temperature is positive and sensor is active: 0*10+1
- third number is 17.
If second Arduino receive 119,11,39 return values are:
- temperature is -11.9 degree Celsius, because 119/10 = 11.9, sign is minus because 11 = 1*10 + 1
- sensor is activated becuse 11 = 1*10 + 1
- level of water is 39%.
I made Multiple Text Fields in Single Message using Arduino (2)
No comments:
Post a Comment