Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <TinyGPS++.h>
- #include <SoftwareSerial.h>
- static const int RXPin = 4, TXPin = 3;
- static const int RXD = 9, TXD = 10;
- static const int TPL = 12;
- static const uint32_t GPSBaud = 9600;
- // The TinyGPS++ object
- TinyGPSPlus gps;
- // The serial connection to the GPS device
- SoftwareSerial serialGps(RXPin, TXPin);
- SoftwareSerial BLE(RXD, TXD);
- void setup(){
- Serial.begin(9600);
- serialGps.begin(GPSBaud);
- BLE.begin(GPSBaud);
- digitalWrite(TPL, LOW);
- }
- void loop(){
- // This sketch displays information every time a new sentence is correctly encoded.
- while (serialGps.available() > 0){
- gps.encode(serialGps.read());
- if (gps.location.isUpdated()){
- char[]lokacija = '';
- BLE.write(gps.location.lat());
- BLE.write(gps.location.lng());
- digitalWrite(TPL, HIGH);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement