
arduino code
#include <TinyGPS++.h> //include TinyGPS library
#define GPS_SERIAL Serial3
#define BLUETOOTH_SERIAL Serial1
#define GPS_BAUD 9600
#define BLUETOOTH_BAUD 9600
TinyGPSPlus gps;
unsigned long lastLocationTime = 0;
unsigned long lastPrintTime = 0;
void setup() {
Serial.begin(9600);
GPS_SERIAL.begin(GPS_BAUD);
BLUETOOTH_SERIAL.begin(BLUETOOTH_BAUD);
Serial.println("start GPS and Bluetooth");
}
void loop() {
while (GPS_SERIAL.available() > 0) {
char c = GPS_SERIAL.read();
gps.encode(c);
Serial.write(c);
if (gps.location.isValid()) {
float lat = gps.location.lat();
float lon = gps.location.lng();
BLUETOOTH_SERIAL.print(lat, 6);
BLUETOOTH_SERIAL.print(",");
BLUETOOTH_SERIAL.print(lon, 6);
BLUETOOTH_SERIAL.println();
Serial.print("latitude: ");
Serial.print(lat, 6);
Serial.print(" / longitude: ");
Serial.println(lon, 6);
lastLocationTime = millis();
}
}
if (millis() - lastLocationTime > 3000 && millis() - lastPrintTime > 3000) {
Serial.println("no location data");
BLUETOOTH_SERIAL.println("no location data");
lastPrintTime = millis();
}
if (millis() > 10000 && gps.charsProcessed() < 10) {
Serial.println("GPS Failed to receive data: Wiring or power check required");
BLUETOOTH_SERIAL.println("GPS Failed to receive data: Wiring or power check required");
while (true);
}
}.
I'm working on using the gps module to display latitude and longitude values. I'm writing the Arduino code and operating it, but the error appears as follows. <runtime error | The operation length of list cannot accept the arguments:,[false]> I started without basic knowledge of the app inventer, so I'm not sure how to solve it. please help........