Can someone help me please. I can't see the location in map widget . I don't what is the problem in this code.
#include <TinyGPS++.h>
#include <SoftwareSerial.h>
#define BLYNK_TEMPLATE_ID "TMPL6EXI40bET"
#define BLYNK_TEMPLATE_NAME "BUS TRACKING"
#define BLYNK_FIRMWARE_VERSION "0.1.0"
#define BLYNK_PRINT Serial
//#define BLYNK_DEBUG
#define APP_DEBUG
*strong text*
// Define the GPS Serial pins
#define RX_PIN 16
#define TX_PIN 17
#define GPS_BAUD 9600
// Define TinyGPS++ object
TinyGPSPlus gps;
// Define SoftwareSerial object
SoftwareSerial gpsSerial(RX_PIN, TX_PIN);
void setup() {
Serial.begin(115200);
gpsSerial.begin(GPS_BAUD);
BlynkEdgent.begin();
}
void loop() {
while (gpsSerial.available() > 0) {
if (gps.encode(gpsSerial.read())) {
// If a new GPS data is parsed
float lat = gps.location.lat();
float lng = gps.location.lng();
// Print latitude and longitude to Serial Monitor
Serial.print("Latitude: ");
Serial.println(lat, 7);
Serial.print("Longitude: ");
Serial.println(lng, 7);
// Send the GPS data to Blynk app
Blynk.virtualWrite(V1, lat); // Assuming V1 is the virtual pin for latitude
Blynk.virtualWrite(V2, lng); // Assuming V2 is the virtual pin for longitude
}
}
BlynkEdgent.run();
}