Use pointers inernally instead of passing objects to save space.

This commit is contained in:
Henrik Ekblad
2014-05-17 00:46:04 +02:00
parent 8e07382d74
commit 9e043f3379
8 changed files with 127 additions and 116 deletions
@@ -61,7 +61,7 @@ void loop()
if (lastTemperature[i] != temperature && temperature != -127.00) {
// Send in the new temperature
gw.send(out.setSensor(i).set(temperature,1));
gw.send(out.setSensor(i)->set(temperature,1));
lastTemperature[i]=temperature;
}
}
@@ -21,7 +21,7 @@ void setup()
gw.sendSketchInfo("Relay", "1.0");
// Fetch relay status
for (int sensor=0, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS;sensor++, pin++) {
for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS;sensor++, pin++) {
// Register all sensors to gw (they will be created as child devices)
gw.present(sensor, S_LIGHT);
// Then set relay pins in output mode