#include #include #include #include #include // Only needed for Arduino 1.6.5 and earlier // Update these with values suitable for your network. // Achtung gleiche mac darf nicht im gleichen Netz auftauchen byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0xDA, 0x9F }; IPAddress ip(192, 168,2 , 202); IPAddress server(192, 168, 2, 71); int W5100_RESET_PIN = 3; // PWM LM358 int pwmOut = 5; //sht // Timing unsigned long readTime; unsigned long pubTime; // Data float temp_c; float old_temp_c = 0; float humidity; float old_humidity; char buffer[10]; String line0; // Relais const int rfrei = 6; const int left = 7; //Status int state = 0; int upm = 0; int lefton = 0; const int idle = 0; // motor aus const int work = 1; // motor an // Specify data and clock connections and instantiate SHT1x object int dataPin = 2; int clockPin = 3; SHT1x sht1x(dataPin, clockPin); void callback(char* topic, byte* payload, unsigned int length) { //Serial.print("Message arrived ["); //Serial.print(topic); //Serial.print("] "); line0=topic; int x = 0; int y = 0; float p = 0; //Serial.println(line0); if (line0.endsWith("drehz")) { for (int i=0;i readTime+500){ readTemp(); } if(millis() > pubTime+1000){ pub_Temp(); } }