X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=wlan_si%2Fwlan_si.ino;h=37ee00eec2b99cec2c2b2aafe5c97d0348b7a4af;hb=2e65e026277652da68ef14608e1404b723fd202b;hp=e2551d863f7221d42cc62f080a4643255aef1e9c;hpb=45c45a2e18ddf0bf77c575e895a32d84f02a6aad;p=Arduino diff --git a/wlan_si/wlan_si.ino b/wlan_si/wlan_si.ino index e2551d8..37ee00e 100644 --- a/wlan_si/wlan_si.ino +++ b/wlan_si/wlan_si.ino @@ -4,6 +4,7 @@ Adafruit_MPL115A2 mpl115a2; int led = 5; // LED on d5 +int pir = 6; // PIR on d6 // hardware based on https://dev.wlan-si.net/wiki/Telemetry/sensgw // original software https://github.com/SloMusti/sensgw @@ -17,6 +18,7 @@ void setup(void) mpl115a2.begin(); pinMode(led, OUTPUT); + pinMode(pir, INPUT); } void loop(void) @@ -27,15 +29,11 @@ void loop(void) mpl115a2.getPT(&pressureKPA,&temperatureC); Serial.print("Pressure="); Serial.print(pressureKPA, 4); Serial.print(" kPa "); - Serial.print("Temp="); Serial.print(temperatureC, 1); Serial.println(" C"); + Serial.print("Temp="); Serial.print(temperatureC, 1); Serial.print(" C"); -/* - pressureKPA = mpl115a2.getPressure(); - Serial.print("Pressure (kPa): "); Serial.print(pressureKPA, 4); Serial.println(" kPa"); + Serial.print(" PIR="); Serial.print( digitalRead(pir) ); - temperatureC = mpl115a2.getTemperature(); - Serial.print("Temp (*C): "); Serial.print(temperatureC, 1); Serial.println(" *C"); -*/ + Serial.println(); digitalWrite(led, LOW);