Skip to content

Instantly share code, notes, and snippets.

@Adekoreday
Created May 19, 2019 12:22
Show Gist options
  • Save Adekoreday/808197f8fb35a778db301eaab4454694 to your computer and use it in GitHub Desktop.
Save Adekoreday/808197f8fb35a778db301eaab4454694 to your computer and use it in GitHub Desktop.
code snippets for an iot-gps tracker
#include "UbidotsMicroESP8266.h"
#include <SoftwareSerial.h>
#include <TinyGPS++.h>
#define TOKEN "BBFF-NZpbtqlig1f6DjMoC5lkov55BKAnXd" // Put here your Ubidots TOKEN
#define WIFISSID "mywifiname" // Put here your Wi-Fi SSID
#define PASSWORD "mypassword" // Put here your Wi-Fi password
Ubidotsclient(TOKEN);
TinyGPSPlusgps;
staticconstintRXPin = 0, TXPin = 4;
staticconst uint32_t GPSBaud = 9600;
// The serial connection to the GPS device
SoftwareSerialss(RXPin, TXPin);
float latt;
float lngg;
float value1 =20;
char context[25];
void setup(){
Serial.begin(115200);
ss.begin(GPSBaud);
Serial.print(F("Testing TinyGPS++ library v. ")); Serial.println(TinyGPSPlus::libraryVersion());
client.wifiConnection(WIFISSID, PASSWORD);
//client.setDebug(true); // Uncomment this line to set DEBUG on
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment