• ESP32-WROOM-DA Module + USB2.0
• Smartphone OS (iPhone SE gen3) + version 16.3.1
• Blynk Library version 1.2.0
- I have been making smart car that can follow me by guiding from my iPhone’s GPS.
- However I’m struggling in sending GPS parameter of iPhone to ESP32 board and can’t print anythings to serial monitor.(It can be print normally if i put Serial.print into void setup;)
- LED on ESP32 on/off properly works.
- I tried blynk’s mapwidget example in arduino IDE but failed to comply with wifi code.
- If i use “GpsParam gps(param);” in Blynk_Write Both will say not
declared in these scope.
/*************************************************************
Blynk is a platform with iOS and Android apps to control
ESP32, Arduino, Raspberry Pi and the likes over the Internet.
You can easily build mobile and web interfaces for any
projects by simply dragging and dropping widgets.
Downloads, docs, tutorials: https://www.blynk.io
Sketch generator: https://examples.blynk.cc
Blynk community: https://community.blynk.cc
Follow us: https://www.fb.com/blynkapp
https://twitter.com/blynk_app
Blynk library is licensed under MIT license
This example code is in public domain.
*************************************************************
This example runs directly on ESP32 chip.
NOTE: This requires ESP32 support package:
https://github.com/espressif/arduino-esp32
Please be sure to select the right ESP32 module
in the Tools -> Board menu!
Change WiFi ssid, pass, and Blynk auth token to run :)
Feel free to apply it to any other example. It's simple!
*************************************************************/
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
/* Fill in information from Blynk Device Info here */
#define BLYNK_TEMPLATE_ID "********"
#define BLYNK_TEMPLATE_NAME "*******"
#define BLYNK_AUTH_TOKEN "********"
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
#include <TinyGPS++.h>
#include <HardwareSerial.h>
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "******";
char pass[] = "******";
int LED_test = 2 ;
//BlynkTimer timer;
void setup()
{
// Debug console
Serial.begin(115200);
Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass, "blynk.cloud", 80);
pinMode(LED_test, OUTPUT);
}
void loop()
{
Blynk.run();
//timer.run();
}
BLYNK_WRITE(V6) {
double latitude = param[0].asDouble();
double longitude = param[1].asDouble();
float altitude = param[2].asFloat();
float speed = param[3].asFloat();
Blynk.virtualWrite(V6, longitude, latitude);
// Print 7 decimal places for Lat
Serial.println(latitude, 7);
Serial.println(longitude, 7);
}
BLYNK_WRITE(2) { //turn right
digitalWrite(LED_test, param.asInt());
}