Skip to content

Commit 3fd767d

Browse files
authored
Merge branch 'master' into master
2 parents 86ddf20 + 7295a00 commit 3fd767d

File tree

10 files changed

+960
-166
lines changed

10 files changed

+960
-166
lines changed

examples/DallasTemperatureSensor/DallasTemperatureSensor.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ void loop()
9090
for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) {
9191

9292
// Fetch and round temperature to one decimal
93-
float temperature = static_cast<float>(static_cast<int>((getConfig().isMetric?sensors.getTempCByIndex(i):sensors.getTempFByIndex(i)) * 10.)) / 10.;
93+
float temperature = static_cast<float>(static_cast<int>((getControllerConfig().isMetric?sensors.getTempCByIndex(i):sensors.getTempFByIndex(i)) * 10.)) / 10.;
9494

9595
// Only send data if temperature has changed and no error
9696
#if COMPARE_TEMP == 1

examples/DhtTemperatureAndHumiditySensor/DhtTemperatureAndHumiditySensor.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
#include <DHT.h>
4545

4646
// Set this to the pin you connected the DHT's data pin to
47-
#define DHT_DATA_PIN 2
47+
#define DHT_DATA_PIN 3
4848

4949
// Set this offset if the sensor has a permanent small offset to the real temperatures
5050
#define SENSOR_TEMP_OFFSET 0
@@ -82,7 +82,7 @@ void presentation()
8282
present(CHILD_ID_HUM, S_HUM);
8383
present(CHILD_ID_TEMP, S_TEMP);
8484

85-
metric = getConfig().isMetric;
85+
metric = getControllerConfig().isMetric;
8686
}
8787

8888

examples/DistanceSensor/DistanceSensor.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ bool metric = true;
5050

5151
void setup()
5252
{
53-
metric = getConfig().isMetric;
53+
metric = getControllerConfig().isMetric;
5454
}
5555

5656
void presentation() {

examples/GPSSensor/GPSSensor.ino

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,22 @@
2020
*
2121
* REVISION HISTORY
2222
* Version 1.0 - Henrik Ekblad
23-
*
23+
*
2424
* DESCRIPTION
25-
* Example sketch showing how to interface with a GPS sensor.
25+
* Example sketch showing how to interface with a GPS sensor.
2626
* A GPS is also an excellent atomic time source.
2727
* http://www.mysensors.org/build/gps
28-
*/
28+
*/
2929

3030
// Enable debug prints to serial monitor
31-
#define MY_DEBUG
31+
#define MY_DEBUG
3232

3333
// Enable and select radio type attached
3434
#define MY_RADIO_NRF24
3535
//#define MY_RADIO_RFM69
3636

3737
// GPS position send interval (in millisectonds)
38-
#define GPS_SEND_INTERVAL 10000
38+
#define GPS_SEND_INTERVAL 10000
3939

4040
// The child id used for the gps sensor
4141
#define CHILD_ID_GPS 1
@@ -47,7 +47,7 @@ static const int GPS_PIN = A0;
4747
static const uint32_t GPSBaud = 9600;
4848

4949
// Offset hours adjustment from gps time (UTC)
50-
const int offset = 1;
50+
const int offset = 1;
5151

5252
#include <SPI.h>
5353
#include <TimeLib.h>
@@ -61,15 +61,15 @@ TinyGPSPlus gps;
6161
MyMessage msg(CHILD_ID_GPS, V_POSITION);
6262

6363
// The serial connection to the GPS device
64-
// A5 pin can be left unconnected
65-
SoftwareSerial ss(GPS_PIN, A5);
64+
// A5 pin can be left unconnected
65+
SoftwareSerial ss(GPS_PIN, A5);
6666

6767
// Last time GPS position was sent to controller
6868
unsigned long lastGPSSent = 0;
6969

70-
// Some buffers
70+
// Some buffers
7171
char latBuf[11];
72-
char lngBuf[11];
72+
char lngBuf[11];
7373
char altBuf[6];
7474
char payload[30];
7575
char sz[64];
@@ -81,7 +81,7 @@ void setup() {
8181
}
8282

8383

84-
void present() {
84+
void presentation() {
8585
// Send the sketch version information to the gateway and Controller
8686
sendSketchInfo("GPS Sensor", "1.0");
8787

@@ -96,10 +96,10 @@ void loop()
9696
// Evaluate if it is time to send a new position
9797
bool timeToSend = currentTime - lastGPSSent > GPS_SEND_INTERVAL;
9898

99-
// Read gps data
100-
while (ss.available())
99+
// Read gps data
100+
while (ss.available())
101101
gps.encode(ss.read());
102-
102+
103103
if (timeToSend) {
104104
// Sync gps time with Arduino
105105
updateTime();
@@ -121,7 +121,7 @@ void loop()
121121
sprintf(sz, "%02d/%02d/%02d %02d:%02d:%02d", month(), day(), year(), hour(), minute(), second());
122122
Serial.println(sz);
123123

124-
124+
125125
} else {
126126
if (millis() > 5000 && gps.charsProcessed() < 10)
127127
Serial.println(F("No GPS data received: check wiring"));
@@ -141,8 +141,6 @@ void updateTime()
141141
setTime(t.hour(), t.minute(), t.second(), d.day(), d.month(), d.year());
142142
adjustTime(offset * SECS_PER_HOUR);
143143
return;
144-
}
144+
}
145145
Serial.println(F("Unable to adjust time from GPS"));
146146
}
147-
148-

0 commit comments

Comments
 (0)