SHARE
TWEET

Untitled

a guest Aug 17th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <SPI.h>
  2. #include <Ethernet.h>
  3. #include <PubSubClient.h>
  4.  
  5. #include <OneWire.h>
  6. #include <DallasTemperature.h>
  7. #include "ACS712.h"
  8.  
  9. //Konfiguracja ETHERNET
  10. byte mac[] = { 0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xED };
  11. IPAddress ip(192, 168, 0, 200);
  12.  
  13. //Konfiguracja MQTT
  14. IPAddress server(192, 168, 0, 54);
  15. IPAddress port(1883);
  16. #define CLIENT_NAME "NOD - GNIAZDKO-KORYTARZ-1"
  17. #define CLIENT_ID "korytarz/gniazdko/1"
  18. #define LOGIN_MQTT "darevil"
  19. #define HASLO_MQTT "darevil"
  20.  
  21. //Wyprowadzenia pinów
  22. #define SSR_PRZYCISK    PB1
  23. #define ACS712_PIN      PC0
  24. #define SSR_PIN         PC2
  25. #define ONE_WIRE_BUS    PD2
  26. #define ETHERNET_LED    PD5
  27. #define MQTT_LED        PD6
  28. #define SSR_LED         PD7
  29.  
  30. //DS18B20
  31. #define TEMPERATURE_PRECISION 10
  32. OneWire oneWire(ONE_WIRE_BUS);
  33. DallasTemperature sensors(&oneWire);
  34.  
  35. //ACS712
  36. ACS712 sensor(ACS712_30A, ACS712_PIN);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top