From a51e0257888a832935136a115d9deb27f27dc892 Mon Sep 17 00:00:00 2001 From: Henrik Ekblad Date: Sat, 22 Mar 2014 16:48:11 +0100 Subject: [PATCH] Removed powerUp. No longer needed. --- .../examples/BatteryPoweredSensor/BatteryPoweredSensor.ino | 1 - .../DallasTemperatureSensor/DallasTemperatureSensor.ino | 1 - libraries/MySensors/examples/DistanceSensor/DistanceSensor.ino | 1 - .../examples/EnergyMeterPulseSensor/EnergyMeterPulseSensor.ino | 2 -- libraries/MySensors/examples/HumiditySensor/HumiditySensor.ino | 1 - libraries/MySensors/examples/LightLuxSensor/LightLuxSensor.ino | 2 -- libraries/MySensors/examples/LightSensor/LightSensor.ino | 2 -- libraries/MySensors/examples/MotionSensor/MotionSensor.ino | 3 ++- libraries/MySensors/examples/PressureSensor/PressureSensor.ino | 2 -- .../MySensors/examples/SoilMoistSensor/SoilMoistSensor.ino | 1 - .../examples/WaterMeterPulseSensor/WaterMeterPulseSensor.ino | 2 -- 11 files changed, 2 insertions(+), 16 deletions(-) diff --git a/libraries/MySensors/examples/BatteryPoweredSensor/BatteryPoweredSensor.ino b/libraries/MySensors/examples/BatteryPoweredSensor/BatteryPoweredSensor.ino index fd320eb..70a8cf8 100644 --- a/libraries/MySensors/examples/BatteryPoweredSensor/BatteryPoweredSensor.ino +++ b/libraries/MySensors/examples/BatteryPoweredSensor/BatteryPoweredSensor.ino @@ -49,7 +49,6 @@ void loop() if (oldBatteryPcnt != batteryPcnt) { // Power up radio after sleep - gw.powerUp(); gw.sendBatteryLevel(batteryPcnt); oldBatteryPcnt = batteryPcnt; } diff --git a/libraries/MySensors/examples/DallasTemperatureSensor/DallasTemperatureSensor.ino b/libraries/MySensors/examples/DallasTemperatureSensor/DallasTemperatureSensor.ino index 6d6252c..e4fe953 100644 --- a/libraries/MySensors/examples/DallasTemperatureSensor/DallasTemperatureSensor.ino +++ b/libraries/MySensors/examples/DallasTemperatureSensor/DallasTemperatureSensor.ino @@ -37,7 +37,6 @@ void setup() void loop() { - gw.powerUp(); sensors.requestTemperatures(); // Fetch temperatures from Dallas delay(100); for (int i=0; i 1000*SEND_FREQUENCY) { - gw.powerUp(); // Power up radio - // New watt value has been calculated if (!SLEEP_MODE && watt != oldWatt) { // Check that we dont get unresonable large watt value. diff --git a/libraries/MySensors/examples/HumiditySensor/HumiditySensor.ino b/libraries/MySensors/examples/HumiditySensor/HumiditySensor.ino index fe040d7..bef4943 100644 --- a/libraries/MySensors/examples/HumiditySensor/HumiditySensor.ino +++ b/libraries/MySensors/examples/HumiditySensor/HumiditySensor.ino @@ -34,7 +34,6 @@ void setup() void loop() { - gw.powerUp(); // Power up radio delay(dht.getMinimumSamplingPeriod()); float temperature = dht.getTemperature(); diff --git a/libraries/MySensors/examples/LightLuxSensor/LightLuxSensor.ino b/libraries/MySensors/examples/LightLuxSensor/LightLuxSensor.ino index b92efad..c995316 100644 --- a/libraries/MySensors/examples/LightLuxSensor/LightLuxSensor.ino +++ b/libraries/MySensors/examples/LightLuxSensor/LightLuxSensor.ino @@ -49,8 +49,6 @@ void setup() void loop() { - gw.powerUp(); // Power up radio (after sleep) - uint16_t lux = lightSensor.readLightLevel();// Get Lux value Serial.println(lux); if (lux != lastlux) { diff --git a/libraries/MySensors/examples/LightSensor/LightSensor.ino b/libraries/MySensors/examples/LightSensor/LightSensor.ino index 671b0c5..0b5de6f 100644 --- a/libraries/MySensors/examples/LightSensor/LightSensor.ino +++ b/libraries/MySensors/examples/LightSensor/LightSensor.ino @@ -26,8 +26,6 @@ void setup() void loop() { - gw.powerUp(); // Power up radio (after sleep) - int lightLevel = (1023-analogRead(LIGHT_SENSOR_ANALOG_PIN))/10.23; Serial.println(lightLevel); if (lightLevel != lastLightLevel) { diff --git a/libraries/MySensors/examples/MotionSensor/MotionSensor.ino b/libraries/MySensors/examples/MotionSensor/MotionSensor.ino index 81ce66b..194aaa4 100644 --- a/libraries/MySensors/examples/MotionSensor/MotionSensor.ino +++ b/libraries/MySensors/examples/MotionSensor/MotionSensor.ino @@ -13,6 +13,8 @@ Sleep sleep; void setup() { + EEPROM.write(EEPROM_RELAY_ID_ADDRESS, 0); + gw.begin(); // Send the sketch version information to the gateway and Controller @@ -25,7 +27,6 @@ void setup() void loop() { - gw.powerUp(); // Power up radio // Read digital motion value boolean tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH; diff --git a/libraries/MySensors/examples/PressureSensor/PressureSensor.ino b/libraries/MySensors/examples/PressureSensor/PressureSensor.ino index 64a484a..603f402 100644 --- a/libraries/MySensors/examples/PressureSensor/PressureSensor.ino +++ b/libraries/MySensors/examples/PressureSensor/PressureSensor.ino @@ -44,8 +44,6 @@ void setup() { void loop() { - gw.powerUp(); // Power up radio - float pressure = bmp.readPressure(); float temperature = bmp.readTemperature(); diff --git a/libraries/MySensors/examples/SoilMoistSensor/SoilMoistSensor.ino b/libraries/MySensors/examples/SoilMoistSensor/SoilMoistSensor.ino index 6658a5f..9cfb218 100644 --- a/libraries/MySensors/examples/SoilMoistSensor/SoilMoistSensor.ino +++ b/libraries/MySensors/examples/SoilMoistSensor/SoilMoistSensor.ino @@ -26,7 +26,6 @@ void setup() void loop() { - gw.powerUp(); // Power up radio // Read digital soil value int soilValue = digitalRead(DIGITAL_INPUT_SOIL_SENSOR); // 1 = Not triggered, 0 = In soil with water if (soilValue != lastSoilValue) { diff --git a/libraries/MySensors/examples/WaterMeterPulseSensor/WaterMeterPulseSensor.ino b/libraries/MySensors/examples/WaterMeterPulseSensor/WaterMeterPulseSensor.ino index 76b31bd..3583ca8 100644 --- a/libraries/MySensors/examples/WaterMeterPulseSensor/WaterMeterPulseSensor.ino +++ b/libraries/MySensors/examples/WaterMeterPulseSensor/WaterMeterPulseSensor.ino @@ -69,8 +69,6 @@ void loop() // Only send values at a maximum frequency or woken up from sleep if (SLEEP_MODE || currentTime - lastSend > 1000*SEND_FREQUENCY) { - gw.powerUp(); // Power up radio - // New flow value has been calculated if (!SLEEP_MODE && flow != oldflow) { // Check that we dont get unresonable large flow value.