Slider wadget sketch tested

With just a arduino card connected to pc i do sketch to test a slider wadget , to start easy programming.

Configure slider on blynk as below
Slider V2, from 0 to 200
Use pin 13 because it has a led in arduino board
Condition
If V2 slider >100 led pin 13 on

// You could use a spare Hardware Serial on boards that have it (like Mega)
#include <SoftwareSerial.h>
SoftwareSerial DebugSerial(2, 3); // RX, TX

#define BLYNK_PRINT DebugSerial
#include <BlynkSimpleStream.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "        ";
void moveControl(int x)
{
   if(x>= 100) //is 
   {
   digitalWrite(13,HIGH);
   }
  else 
  {
     digitalWrite(13,LOW);
  }
}
void setup()
{
  // Debug console
  DebugSerial.begin(9600);

  // Blynk will work through Serial
  // Do not read or write this serial manually in your sketch
  Serial.begin(9600);
  Blynk.begin(Serial, auth);
  pinMode(13,OUTPUT);
}

void loop()
{
  Blynk.run();
}
BLYNK_WRITE(V2)
{
  int x = param.asInt();
  moveControl(x); 
}
2 Likes

Nice work

1 Like