Greetings everybody! I am working on a project where I require to send sensor value from an FSR to a virtual pin (V2)
• Hardware model + communication type: Arduino UNO Wifi Rev2
• Blynk server
• Blynk Library version 1.2.0
The problem is, the virtual pin doesnt seem to register/update the values when I press my FSR.
here’s the code :
/* Fill-in information from Blynk Device Info here */
#define BLYNK_TEMPLATE_ID "TMPLQoMt10rp"
#define BLYNK_TEMPLATE_NAME "Servo Control and FSR"
#define BLYNK_AUTH_TOKEN "REDACTED"
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
#include <SPI.h>
#include <WiFiNINA.h>
#include <BlynkSimpleWiFiNINA.h>
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "JioFiber";
char pass[] = "REDACTED";
int fsrPin = 0; // the FSR and 10K pulldown are connected to A0
int fsrReading; // the analog reading from the FSR resistor divider
void setup(void)
{
Serial.begin(115200);
Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass);
}
BLYNK_WRITE(V2)
{
fsrReading = analogRead(fsrPin);
//Serial.println(fsrReading);
Blynk.virtualWrite(V2, fsrReading);
}
void loop()
{
Blynk.run();
}
any help will be most appreciated. Thanks.