Skip to content

Fix missing presentation function #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 6, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 16 additions & 18 deletions examples/GPSSensor/GPSSensor.ino
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@
*
* REVISION HISTORY
* Version 1.0 - Henrik Ekblad
*
*
* DESCRIPTION
* Example sketch showing how to interface with a GPS sensor.
* Example sketch showing how to interface with a GPS sensor.
* A GPS is also an excellent atomic time source.
* http://www.mysensors.org/build/gps
*/
*/

// Enable debug prints to serial monitor
#define MY_DEBUG
#define MY_DEBUG

// Enable and select radio type attached
#define MY_RADIO_NRF24
//#define MY_RADIO_RFM69

// GPS position send interval (in millisectonds)
#define GPS_SEND_INTERVAL 10000
#define GPS_SEND_INTERVAL 10000

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

// Offset hours adjustment from gps time (UTC)
const int offset = 1;
const int offset = 1;

#include <SPI.h>
#include <TimeLib.h>
Expand All @@ -61,15 +61,15 @@ TinyGPSPlus gps;
MyMessage msg(CHILD_ID_GPS, V_POSITION);

// The serial connection to the GPS device
// A5 pin can be left unconnected
SoftwareSerial ss(GPS_PIN, A5);
// A5 pin can be left unconnected
SoftwareSerial ss(GPS_PIN, A5);

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

// Some buffers
// Some buffers
char latBuf[11];
char lngBuf[11];
char lngBuf[11];
char altBuf[6];
char payload[30];
char sz[64];
Expand All @@ -81,7 +81,7 @@ void setup() {
}


void present() {
void presentation() {
// Send the sketch version information to the gateway and Controller
sendSketchInfo("GPS Sensor", "1.0");

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

// Read gps data
while (ss.available())
// Read gps data
while (ss.available())
gps.encode(ss.read());

if (timeToSend) {
// Sync gps time with Arduino
updateTime();
Expand All @@ -121,7 +121,7 @@ void loop()
sprintf(sz, "%02d/%02d/%02d %02d:%02d:%02d", month(), day(), year(), hour(), minute(), second());
Serial.println(sz);


} else {
if (millis() > 5000 && gps.charsProcessed() < 10)
Serial.println(F("No GPS data received: check wiring"));
Expand All @@ -141,8 +141,6 @@ void updateTime()
setTime(t.hour(), t.minute(), t.second(), d.day(), d.month(), d.year());
adjustTime(offset * SECS_PER_HOUR);
return;
}
}
Serial.println(F("Unable to adjust time from GPS"));
}