Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #include "Device.h"
  2.  
  3. #include "etherShield.h"
  4. #include "ETHER_28J60.h"
  5. #include "Ethernet.h"
  6.  
  7. Device homeDevice=Device("central-device");
  8. Ethernet ethernet=Ethernet(&homeDevice);
  9.  
  10. void setup() {
  11.   homeDevice.add("buzz",         PWM,   6);
  12.   homeDevice.add("fan",          PWM,   9);
  13.   homeDevice.add("pwm-aux1",     PWM,   3);
  14.   homeDevice.add("pwm-aux2",     PWM,   5);
  15.  
  16.  
  17.   homeDevice.add("speaker",      DIGITAL, 4);
  18.   homeDevice.add("relay1",       DIGITAL, 7);
  19.   homeDevice.add("relay2",       DIGITAL, 8);
  20.   homeDevice.add("relay3",       DIGITAL, 15);
  21.   homeDevice.add("relay4",       DIGITAL, 14);
  22.   homeDevice.add("light",        ANALOG, 3);
  23.   homeDevice.add("temp",         ANALOG,  2);
  24.   //Starting booth communication!
  25.   Serial.begin(115200);
  26.   int ip[]={192,168,1,15};
  27.   ethernet.startNetwork(ip);
  28. }
  29.  
  30. void loop() {
  31.   homeDevice.loop();
  32.   ethernet.loop();
  33. }