#include <string.h>
#include <SPI.h>
#include <Ethernet2.h>
#include <RCSwitch.h>
#include "DHT.h"
#include <stdio.h>
#define DHTTYPE DHT22
#define DHTPIN 5
RCSwitch mySwitch = RCSwitch();
DHT dht(DHTPIN, DHTTYPE);
byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
IPAddress ip(192, 168, 1, 106);
IPAddress gateway(192, 168, 1, 1);
IPAddress subnet(255, 255, 255, 0);
EthernetServer server(80);
//Sensori
char dato[24] = "";
byte conta = 0;
char d;
const int value = mySwitch.getReceivedValue();
String readString; //stringhe
boolean ledon1 = false;
boolean ledon2 = false;
boolean ledon3 = false;
boolean ledon4 = false;
boolean ledon5 = false;
void setup() {
Serial.begin(9600);
Serial1.begin(9600);
dht.begin();
Ethernet.begin(mac, ip);
mySwitch.enableTransmit(31);
}
void loop() {
if (Serial1.available()>0) {
while (Serial1.available())
{
d = Serial1.read();
Serial.write(d);
if(d != ""){
dato[conta] = d;
conta++;
} else {
for (int i = 0; i < 24; i++)
dato[i] = 0;
}
}
}
Ora riesco a visualizzare i valori su pagina html solo che anzichè svuotare ciò che c'è dentro la seriale,arduino la sovrappone creando una serie di ripetizioni finchè ad un certo punto si blocca arduino e non riesco più ad accedere alla pagina Html.
Se qualcuno può darmi una mano