HI,
i have a mega which is getting some info from a data bus (yes i need mega for UART), what i want to do is send the data over Serial2 to a attached UNO. This Uno has built in ESP8266 (yes from .org) and is pushing this data to my domoticz server.
How can i best accomplish this??? I2C or just soft(serial)???
I like to put all data in a string and end it with /r/n or (&(^*, so my UNO has to look at the end of the string (have to figure out how) and put that data in serveral integers or floats. That part i don't understand completely, how do i cut the string to different pieces and put them in a int or float???
Just use I2C, if you're going to use SoftSerial you could have used the Uno in the first place. After that the same as Robin2's Serial Input Basis updated applies ![:slight_smile: :slight_smile:](https://emoji.discourse-cdn.com/twitter/slight_smile.png?v=12)
And why do you need to split it again? The Uno has to talk to the ESP266 again and it doesn't talk in variables....
But the Uno is still overkill... That would mean you use 3 micro controllers... Of which the ESP266 is the most powerful (even more powerful then the Uno and Mega combined). Why not run everything on a ESP8266? Or at least connect it straight to the Mega.
PS A float doesn't just mean a decimal point ![:wink: :wink:](https://emoji.discourse-cdn.com/twitter/wink.png?v=12)
delchrys:
I like to put all data in a string and end it with /r/n or (&(^*, so my UNO has to look at the end of the string (have to figure out how) and put that data in serveral integers or floats. That part i don't understand completely, how do i cut the string to different pieces and put them in a int or float???
Read the updated Serial Input Basics thread to get ideas for the communication protocol; personally I would use example 3 and if needed modify the start-and endmarkers to 0x02 (STX, see ascii table) and 0x03 (ETX, see ascii table) if the real string can contain those characters.
Note that, although the above thread is written with serial communication in mind, it can be applied to any form of communication (wireless, I2C, ...).