Guest User

ethrawtest

a guest
Mar 14th, 2013
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #include <EthernetRaw.h>
  2. #include <socket.h>
  3. #include <avr/wdt.h>
  4.  
  5. byte mac[] = { 0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02 };
  6. //byte mac_dest[] = { 0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02 };
  7.  
  8. EthernetRawClass client;
  9.  
  10. void setup() {
  11. wdt_disable();
  12. // Open serial communications and wait for port to open:
  13. Serial.begin(9600);
  14. Serial.println("Waiting one second");
  15. delay(1000);
  16.  
  17. client.begin(mac);
  18. }
  19.  
  20. void loop()
  21. {
  22. Serial.println("loop");
  23. if (client.available()) {
  24. Serial.println("On trouve quelque-chose à lire");
  25. char c = client.read();
  26. Serial.print(c);
  27. }
  28. delay(1000);
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment