Use pointers inernally instead of passing objects to save space.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user