Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <EasyTransfer.h>
- //create object
- EasyTransfer ET;
- struct SEND_DATA_STRUCTURE{
- //put your variable definitions here for the data you want to send
- //THIS MUST BE EXACTLY THE SAME ON THE OTHER ARDUINO
- String ahoj;
- };
- //give a name to the group of data
- SEND_DATA_STRUCTURE mydata;
- void setup(){
- Serial.begin(9600);
- //start the library, pass in the data details and the name of the serial port. Can be Serial, Serial1, Serial2, etc.
- ET.begin(details(mydata), &Serial);
- randomSeed(analogRead(0));
- }
- void loop(){
- //this is how you access the variables. [name of the group].[variable name]
- mydata.ahoj = ('Zdravim');
- //send the data
- ET.sendData();
- delay(5000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement