Previous                                    Tutorial                                  Tutorial

Authorized Online Retailers:

Purchase from US         Purchase from Japan

AMAZON                 

Introduction

In this lesson, we will show how to use the Osoyoo Yun IoT Kit with the Blynk APP to control a LED.

Preparations

HARDWARE

SOFTWARE

Connection

Build the circuit as below:

Here we connect the LED to digital pin D8.

Code Program

After above operations are completed, make sure that the Yun Shield is on the same network with the computer. Open the Arduino IDE and choose corresponding board type and port type for you project. Then load up the following sketch onto your Arduino.


You can find the Arduino sketch here.

In this example sketch, find this line:

char auth[] =”YourAuthToken”;

This is the Auth Token that you emailed yourself. Please check your email and copy it, then paste it inside the quotation marks.

It should look similar to this:

char auth[] = “f45626c103a94983b469637978b0c78a”;

Upload the sketch to the board. Wait until you see something like this:

avrdude done.  Thank you.

Congrats! You are all set! Now your hardware is connected to the Blynk Cloud!

Add a Widget

Your project canvas is empty, let’s add a button to control our LED.

Tap anywhere on the canvas to open the widget box. All the available widgets are located here. Now pick a button.

Widget Box

Drag-n-Drop – Tap and hold the Widget to drag it to the new position.

Widget Settings – Each Widget has it’s own settings. Tap on the widget to get to them.

The most important parameter to set is PIN . The list of pins reflects physical pins defined by your hardware. If your LED is connected to Digital Pin 8 – then select D8 (D – stands for Digital).

Running Result

After you finished all above operations,open the Serial Monitor and you will see the connection situation,then open the Blynk APP, press the PLAY button. This will switch you from EDIT mode to PLAY mode where you can interact with the hardware. While in PLAY mode, you won’t be able to drag or set up new widgets, press STOP and get back to EDIT mode.

At the same time, you can see the hardware side as below:

So, you just have completed a LED remote control experiment.

Previous                                    Tutorial                                  Tutorial