Guest User

Untitled

a guest
Mar 13th, 2014
169
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. typedef struct{
  2.     int num1;
  3.     int num2;
  4.     int num3;
  5.     int num4;
  6.     int num5;
  7. } numbers_s;
  8.  
  9. numbers_s myNumbers;
  10.  
  11. void main()
  12. {
  13.  
  14. }
  15.  
  16. void loop()
  17. {
  18.     // For sending:
  19.  
  20.     // Set some numbers
  21.     myNumbers.num1 = 5;
  22.     myNumbers.num2 = 4;
  23.     myNumbers.num3 = 77;
  24.     myNumbers.num4 = 865;
  25.     myNumbers.num5 = 6254;
  26.  
  27.     // Set data
  28.     nRF905_setData(&myNumbers, sizeof(myNumbers));
  29.  
  30.     delay(1000);
  31.  
  32.  
  33.  
  34.  
  35.     // For receiving:
  36.  
  37.     // Wait for data
  38.     while(!nRF905_getData(&myNumbers, sizeof(myNumbers)));
  39.  
  40.     // Print data
  41.     Serial.println(myNumbers.num1);
  42.     Serial.println(myNumbers.num2);
  43.     Serial.println(myNumbers.num3);
  44.     Serial.println(myNumbers.num4);
  45.     Serial.println(myNumbers.num5);
  46. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×