Hello everyone ,
quick back story , Purchased my first Arduino board today , ESP32 Dev Board for a project i am going to work on over Christmas.
I got a few relays and analog thermister ,
i have never programmed a thing in my life and today i managed to get my esp32 online and connected to my iPhone blynk app , and output thermister reading to my phone though it is reading the wrong value.
I have searched this forum and the net for a few hours and cant seem to find anyone with the same issue as me.please find attached pic. I just need a push in the right direction.
Thanks so much!
ESP32 Dev Board
XC4494 Analog Temperature Module
Blynk v0.5.4
iPhone xs 12.1
Arduino IDE 1.8.8
/*************************************************************
Download latest Blynk library here:
https://github.com/blynkkk/blynk-library/releases/latest
Blynk is a platform with iOS and Android apps to control
Arduino, Raspberry Pi and the likes over the Internet.
You can easily build graphic interfaces for all your
projects by simply dragging and dropping widgets.
Downloads, docs, tutorials: http://www.blynk.cc
Sketch generator: http://examples.blynk.cc
Blynk community: http://community.blynk.cc
Follow us: http://www.fb.com/blynkapp
http://twitter.com/blynk_app
Blynk library is licensed under MIT license
This example code is in public domain.
*************************************************************
You’ll need:
- Blynk App (download from AppStore or Google Play)
- ESP32 board
- Decide how to connect to Blynk
(USB, Ethernet, Wi-Fi, Bluetooth, ...)
There is a bunch of great example sketches included to show you how to get
started. Think of them as LEGO bricks and combine them as you wish.
For example, take the Ethernet Shield sketch and combine it with the
Servo example, or choose a USB sketch and add a code from SendData
example.
*************************************************************/
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "";
char pass[] = "";
const int analogPin = 36; // Analog input pin 0 (GPIO 36)
int sensorValue = 0; // Value read from the ADC
BlynkTimer timer;
void setup() {
Serial.begin(9600); // Initialize serial monitor output at 9600 bps:
Blynk.begin(auth, ssid, pass); // Connect to Blynk Cloud
timer.setInterval(250L, AnalogPinRead); // Run sensor scan 4 times a second
}
void AnalogPinRead() {
sensorValue = analogRead(analogPin); // Read the analog in value:
Serial.print("sensor = "); // Print the results...
Serial.println(sensorValue); // ...to the serial monitor:
Blynk.virtualWrite(V0, sensorValue); // Send the results to Gauge Widget
}
void loop() {
Blynk.run();
timer.run();
}
void loop()