Controlling LED Using Blynk

Controlling LED Using Blynk © GPL3+

Control your LED on Arduino UNO using Blynk App.

  • 8,965 views
  • 0 comments
  • 14 respects

Components and supplies

Apps and online services

About this project

We will use Blynk app to control our on board LED of Arduino UNO. In Blynk you can connect it to cloud and by installing Blynk libraries and providing author token you can have access to your board.

Step 1:

Sign in to Blynk app and create a new project.

Step 2:

Give a name to your project. Choose device as Arduino UNO. Select Connection type as USB.

Step 3:

Check your E-mail for Author Token.

Step 4:

Select "ADD DEVICE" and add Button. Click on button you added. There opens Button Manager. In output select Digital 13th pin.

Step 5:

In Code copy and paste your Author Token.

Step 6:

Open Command Prompt. Write

cd "Your Blynk Scripts address" 

then press enter.

Step 7:

Now write blynk-ser.bat -c COM3 or any com your device is connected. Press enter. Now you can control your device with Blynk.

Code

Untitled fileC/C++
Download Blynk library at https://github.com/blynkkk/blynk-library/releases/tag/v0.4.8
/*************************************************************
  Download latest Blynk library here:
    https://github.com/blynkkk/blynk-library/releases/latest

  Blynk is a platform with iOS and Android apps to control
  Arduino, Raspberry Pi and the likes over the Internet.
  You can easily build graphic interfaces for all your
  projects by simply dragging and dropping widgets.

    Downloads, docs, tutorials: http://www.blynk.cc
    Sketch generator:           http://examples.blynk.cc
    Blynk community:            http://community.blynk.cc
    Follow us:                  http://www.fb.com/blynkapp
                                http://twitter.com/blynk_app

  Blynk library is licensed under MIT license
  This example code is in public domain.

 *************************************************************
  =>
  =>          USB HOWTO: http://tiny.cc/BlynkUSB
  =>

  You can send/receive any data using WidgetTerminal object.

  App project setup:
    Terminal widget attached to Virtual Pin V1
 *************************************************************/

/* Comment this out to disable prints and save space */
#define BLYNK_PRINT SwSerial


#include <SoftwareSerial.h>
SoftwareSerial SwSerial(10, 11); // RX, TX
    
#include <BlynkSimpleStream.h>

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

// Attach virtual serial terminal to Virtual Pin V1
WidgetTerminal terminal(V1);

// You can send commands from Terminal to your hardware. Just use
// the same Virtual Pin as your Terminal Widget
BLYNK_WRITE(V1)
{

  // if you type "Marco" into Terminal Widget - it will respond: "Polo:"
  if (String("Marco") == param.asStr()) {
    terminal.println("You said: 'Marco'") ;
    terminal.println("I said: 'Polo'") ;
  } else {

    // Send it back
    terminal.print("You said:");
    terminal.write(param.getBuffer(), param.getLength());
    terminal.println();
  }

  // Ensure everything is sent
  terminal.flush();
}

void setup()
{
  // Debug console
  SwSerial.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);

  // This will print Blynk Software version to the Terminal Widget when
  // your hardware gets connected to Blynk Server
  terminal.println(F("Blynk v" BLYNK_VERSION ": Device started"));
  terminal.println(F("-------------"));
  terminal.println(F("Type 'Marco' and get a reply, or type"));
  terminal.println(F("anything else and get it printed back."));
  terminal.flush();
}

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

Comments

Similar projects you might like

How to Add an LED with Blynk on Linux

Project tutorial by Tech with Matthew

  • 1,626 views
  • 2 comments
  • 5 respects

Controlling LED Brightness Using Bolt and Arduino

Project tutorial by Devashish Gupta

  • 1,638 views
  • 4 comments
  • 13 respects

Bluetooth control led with lcd led status display real time.

Project tutorial by Youssef Sabaa

  • 17,299 views
  • 4 comments
  • 34 respects

LED Emergency Lights using WS2812 RGB LED Module

Project tutorial by bigboystoys13

  • 10,004 views
  • 5 comments
  • 20 respects
Add projectSign up / Login