BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Want to improve my programming skills need help


#1

#define BLYNK_PRINT Serial
#include <SPI.h>
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = “xxxxxxxxxxx”;

void setup()
{
Serial.begin(9600);
Blynk.begin(auth);
}

// This function will be called every time Slider Widget
// in Blynk app writes values to the Virtual Pin 1
BLYNK_WRITE(V1)
{
int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable
// You can also use:
// String i = param.asStr();
// double d = param.asDouble();
Serial.print("V1 Slider value is: ");
Serial.println(pinValue);
String i = param.asStr();
Blynk.virtualWrite(V5,i);
}

void loop()
{
Blynk.run();
}

problem is i am getting values on serial monitor that is 0 and 1 i want to see same on value widget i tried giving virtual write its not reflecting why i am not getting values on widgets


#2

Let’s start by wrapping your code so we can see it better :wink:

Watch the animated gif at [README] Welcome to Blynk Community!

Then, I believe you should be using the variable pinValue instead if i to output the slider value to the Value Display.

As for further code usages, I recommend https://www.arduino.cc/en/Reference/HomePage combined with trial, error, trial, error, trial, success… works for me :grinning:


#3

if you really would like to improve your programming skills, i would recommend to read and learn some specific books, and begin with learning general programming strategies.

i can recommend to you the very great book by allen b. downey: think python http://greenteapress.com/wp/think-python-2e/

it is definitely not a one weekend project, needs time + patience, but on the long run it well worths the investment. python is a very friendly language, ideal for beginners. indeed, it is not mainly used in embedded programing, but the concepts and strategies you learn from this book are universal amongst all languages.


#4

thanks a lot im already using this books :smiley: