Allow sensors to re-present themselves on request from controller. All

presentations actions moved to their own function in the examples.
This commit is contained in:
Henrik Ekblad
2015-09-27 18:04:05 +02:00
parent aa22a3eaec
commit 415aa29b34
49 changed files with 281 additions and 169 deletions
@@ -95,10 +95,6 @@ void setup()
// Set analog led pin to off
analogWrite( LED_PIN, 0);
// Send the Sketch Version Information to the Gateway
present(CHILD_ID_LIGHT, S_DIMMER);
sendSketchInfo(SN, SV);
// Retreive our last dim levels from the eprom
fadeTo = dimValue = 0;
byte oldLevel = loadLevelState(EEPROM_DIM_LEVEL_LAST);
@@ -109,6 +105,12 @@ void setup()
Serial.println("Ready to receive messages...");
}
void presentation() {
// Send the Sketch Version Information to the Gateway
present(CHILD_ID_LIGHT, S_DIMMER);
sendSketchInfo(SN, SV);
}
void loop()
{
// Check if someone turned the rotary encode