Hello,
I’m trying to use Blynk to set up an app to monitor temperatures, humidities, and light using the I2C protocol. The ESP32 works fine when I output data from a digital temperature sensor (TMP42) to the serial port, but when I try to add in the Blynk code all hell breaks loose. The error codes, which are almost unintelligible to me (I’m not a programmer) suggest that Blynk doesn’t like the LibTempTMP421.h library, throwing a slew of messages like:
“**/Users/michaelreid/Documents/Arduino/libraries/Blynk/src/Blynk/BlynkParam.h:307:10: note: no known conversion for argument 1 from ‘LibTempTMP421’ to ‘unsigned int’**
**/Users/michaelreid/Documents/Arduino/libraries/Blynk/src/Blynk/BlynkParam.h:313:10: note: candidate: void BlynkParam::add(long int)**
** void BlynkParam::add(long value)**”
Here’s the code that I’m testing:
#include "LibTempTMP421.h"
/* ESP & Blynk */
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
//#define BLYNK_DEBUG //enables verbose prints to the serial port
//#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
BlynkTimer timer;
int timerID;
char auth[] = "";
/* WiFi credentials */
char ssid[] = "";
char pass[] = "";
//address of temperature sensor
LibTempTMP421 temp = LibTempTMP421(0);
void setup()
{
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
timerID = timer.setInterval(5000L, gettemp); \\ wait 5 seconds, then call temperature read function
}
void loop()
{
timer.run();
Blynk.run();
}
void gettemp(void)
{
// temperature module
float tempF = 0;
tempF = (temp.GetTemperature()*9/5+32);
Blynk.virtualWrite(10, temp); //virtual pin V10);
}
I was so excited to watch the video introducing Blynk and the promise that I could have an app running in 5 minutes (or was that 51 seconds?). So far I’ve spent about 5 hours, and am ready to give up! Any suggestions would be greatly appreciated.
msreid0