Im trying to analogRead (A0) - for instance-, but graph refreshing time is 1 sec for analog pins. There is any way to make it realtime (live) or to use push option (converting analog pin to a virtual pin). If so, what would be the code?
We donât teach programming here⌠but we can direct you to the Documents, Help Center and Sketch Builder (Links all at the top right of this page⌠scroll up if you donât see them.
for exampleâŚ
Meanwhile, here is some of the relevant commands needed, with your widget set to PUSH
Shows up an error, i have downloaded all the drivers.
prueba_emg_plot_ios:10: error: 'BlynkTimer' does not name a type
BlynkTimer timer;
^
/Users/yow/Documents/Arduino/prueba_emg_plot_ios/prueba_emg_plot_ios.ino: In function 'void myTimerEvent()':
prueba_emg_plot_ios:17: error: 'sensorData' was not declared in this scope
sensorData = analogRead(A0);
^
/Users/yow/Documents/Arduino/prueba_emg_plot_ios/prueba_emg_plot_ios.ino: In function 'void setup()':
prueba_emg_plot_ios:32: error: 'timer' was not declared in this scope
timer.setInterval(1000L, myTimerEvent);
^
/Users/yow/Documents/Arduino/prueba_emg_plot_ios/prueba_emg_plot_ios.ino: In function 'void loop()':
prueba_emg_plot_ios:38: error: 'timer' was not declared in this scope
timer.run(); // Initiates BlynkTimer
^
exit status 1
'BlynkTimer' does not name a type
here is my code.
#define BLYNK_PRINT Serial1
#include <BlynkSimpleStream.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = âYourAuthTokenâ;
BlynkTimer timer;
// This function sends Arduinoâs up time every second to Virtual Pin (5).
// In the app, Widgetâs reading frequency should be set to PUSH. This means
// that you define how often to send data to Blynk App.
void myTimerEvent()
{
sensorData = analogRead(A0);
Blynk.virtualWrite(V5, sensorData);
}
Yes, updated Blank Library, but a new error comes up: (same code as before)
sketch_jan04b:7: error: stray â\342â in program
char auth[] = âc27f5f4c412643fc9e4XXXXXXâ;
^
sketch_jan04b:7: error: stray â\200â in program
sketch_jan04b:7: error: stray â\234â in program
sketch_jan04b:7: error: stray â\342â in program
sketch_jan04b:7: error: stray â\200â in program
sketch_jan04b:7: error: stray â\235â in program
sketch_jan04b:7: error: âc27f5f4c412643fc9e4XXXXXXâ was not declared in this scope
char auth[] = âc27f5f4c412643fc9e4XXXXXXâ;
^
/Users/yow/Documents/Arduino/sketch_jan04b/sketch_jan04b.ino: In function âvoid myTimerEvent()â:
sketch_jan04b:16: error: âsensorDataâ was not declared in this scope
sensorData = analogRead(A0);
^
exit status 1
stray â\342â in program
Google these errors to see if you can determine their relevance in the syntax of your skript
Also Google this part of the error⌠it basically means you havenât âdeclaredâ this âvariableâ or whatever the js equivalent of those terms are
This is all âhow to program 101â, and not really Blynk specific, and you will keep running into similar issues/solutions as get more familiar with the whole syntax of the programming language.
Find a good online course or âHow Toâ for NodeJS.