Advertisement
Guest User

Untitled

a guest
May 26th, 2022
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. #include <EasyTransfer.h>
  2.  
  3. //create object
  4. EasyTransfer ET;
  5.  
  6. struct SEND_DATA_STRUCTURE{
  7. //put your variable definitions here for the data you want to send
  8. //THIS MUST BE EXACTLY THE SAME ON THE OTHER ARDUINO
  9. String ahoj;
  10. };
  11.  
  12. //give a name to the group of data
  13. SEND_DATA_STRUCTURE mydata;
  14.  
  15. void setup(){
  16. Serial.begin(9600);
  17. //start the library, pass in the data details and the name of the serial port. Can be Serial, Serial1, Serial2, etc.
  18. ET.begin(details(mydata), &Serial);
  19.  
  20.  
  21. randomSeed(analogRead(0));
  22.  
  23. }
  24.  
  25. void loop(){
  26. //this is how you access the variables. [name of the group].[variable name]
  27. mydata.ahoj = ('Zdravim');
  28. //send the data
  29. ET.sendData();
  30.  
  31.  
  32. delay(5000);
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement