Compare commits
3 Commits
f979f8e3df
...
f37bae70e9
| Author | SHA1 | Date | |
|---|---|---|---|
| f37bae70e9 | |||
| 6c8d22eb91 | |||
| f2de6a4c60 |
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
20250815_basic_finder.ino/config_secrets.h
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -46,10 +46,15 @@ void setup(void) {
|
|||
|
||||
Serial.begin(115200);
|
||||
|
||||
pinMode(LED_PIN, OUTPUT);
|
||||
|
||||
if (wifi_set_main()) {
|
||||
Serial.println("Connect WIFI SUCCESS");
|
||||
connected = true;
|
||||
|
||||
} else {
|
||||
|
||||
digitalWrite(LED_PIN, LOW);
|
||||
Serial.println("Connect WIFI FAULT");
|
||||
}
|
||||
|
||||
|
|
@ -59,7 +64,7 @@ void setup(void) {
|
|||
gpsSerial.begin(GPS_BAUD, SERIAL_8N1, RXD2, TXD2);
|
||||
Serial.println("Serial 2 started at 9600 baud rate");
|
||||
|
||||
pinMode(LED_PIN, OUTPUT);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -79,9 +84,12 @@ void drawTriangles(byte i, char *time, char *distanceString) {
|
|||
bool doHttpRequest(char *payload, char *latitude, char *longitude, char *gpsTime) {
|
||||
HTTPClient http;
|
||||
// Change space to 0
|
||||
*(latitude + 6) = '0';
|
||||
|
||||
String serverPath = webserviceAddress + "?long=" + longitude + "&lat=" + latitude + "&id=" + OWN_ID + "&req_id=" + REQ_ID + "&gpsDateTime=" + gpsTime;
|
||||
|
||||
if(*(latitude + 6) < '0' || *(latitude + 6) > '9')
|
||||
*(latitude + 6) = '0';
|
||||
|
||||
String serverPath = webserviceAddress + "?long=" + longitude + "&lat=" + latitude + "&id=" + OWN_ID + "&req_id=" + REQ_ID + "&gpsDateTime=" + gpsTime + "&passkey=" + SERVER_PASSKEY;
|
||||
|
||||
Serial.println(serverPath);
|
||||
|
||||
|
|
@ -138,6 +146,12 @@ void setDistanceBearingString(char *time, char *distance, byte *bearing, const c
|
|||
|
||||
|
||||
void loop(void) {
|
||||
if(connected) {
|
||||
digitalWrite(LED_PIN, HIGH);
|
||||
}
|
||||
else {
|
||||
digitalWrite(LED_PIN, LOW);
|
||||
}
|
||||
while (gpsSerial.available() > 0) {
|
||||
// get the byte data from the GPS
|
||||
char gpsData = gpsSerial.read();
|
||||
|
|
@ -188,9 +202,7 @@ void loop(void) {
|
|||
|
||||
Serial.println("-------------------------------");
|
||||
|
||||
digitalWrite(LED_PIN, HIGH);
|
||||
delay(3000);
|
||||
|
||||
delay(5000);
|
||||
|
||||
digitalWrite(LED_PIN, LOW);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -431,6 +431,21 @@ int wifi_set_main()
|
|||
|
||||
Serial.println("Please connect \"Makerfabs_ap\".");
|
||||
Serial.println("And visit 192.168.4.1 to set WIFI.");
|
||||
|
||||
|
||||
digitalWrite(LED_PIN, HIGH);
|
||||
delay(100);
|
||||
digitalWrite(LED_PIN, LOW);
|
||||
delay(100);
|
||||
digitalWrite(LED_PIN, HIGH);
|
||||
delay(100);
|
||||
digitalWrite(LED_PIN, LOW);
|
||||
delay(100);
|
||||
digitalWrite(LED_PIN, HIGH);
|
||||
delay(100);
|
||||
digitalWrite(LED_PIN, LOW);
|
||||
delay(100);
|
||||
|
||||
ap_init();
|
||||
while (wifi_config_server())
|
||||
;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user