Update interval, adjust light range

This commit is contained in:
Nico Schottelius 2016-09-17 05:35:39 +02:00
parent 2015ca59b1
commit 7ab68e218c

View file

@ -117,7 +117,7 @@ int readLoudness()
int readLight() int readLight()
{ {
return analogRead(LIGHT_SENSOR); return analogRead(LIGHT_SENSOR) / 1000;
} }
void setupWater() { void setupWater() {
@ -241,6 +241,12 @@ void sendPacket(String packet){
} }
void loop() { void loop() {
/* Announce begin of code */
blink(20); delay(50);
blink(20); delay(50);
blink(20); delay(50);
loudness = readLoudness(); loudness = readLoudness();
String data_loudness = String("loudness=" + String(loudness, DEC)); String data_loudness = String("loudness=" + String(loudness, DEC));
@ -265,7 +271,17 @@ void loop() {
} }
debugSerial.println(data_magnet); debugSerial.println(data_magnet);
/* Blink long after sending packet */
sendPacket(data_loudness);
blink(20); delay(2980);
sendPacket(data_light);
blink(20); delay(2980);
sendPacket(data_water);
blink(20); delay(2980);
sendPacket(data_magnet);
/* Blink long after sending packet
if(counter >= 10) { if(counter >= 10) {
// Beep(20); // Beep(20);
blink(20); blink(20);
@ -283,6 +299,7 @@ void loop() {
blink(30); blink(30);
counter++; counter++;
} }
*/
delay(1000); // delay(1000);
} }