Day 7 - Section 4 - Controlling a device
Site: | ΕΛ/ΛΑΚ Moodle |
Course: | Robotics - 3D Printing - Internet of Things |
Book: | Day 7 - Section 4 - Controlling a device |
Printed by: | Guest user |
Date: | Monday, 30 December 2024, 7:42 PM |
Description
After the completion of this section the students will be able to:
- create a new project in Blynk
- place widgets inside Blynk's desktop
- adjust Blynk's widgets
- prepare the code to make our device communicate with the smartphone
- create a circuit to experiment with blinking a LED via their smartphone
Creating a new project in Blynk
In this section we will learn how to control a remote device using the smartphone
At the beginning we usually plan and design our application, but we can modify or even change anything later. As a first application we will control an led that we will connect to our arduino IDE micro controller unit (MCU)
At the moment an email was sent to your account with the authentication token of the project but you can find it and copy it or resend it inside the menu project settings |
Inside the project
- Click on the plus sign
- Select Button
- Click on the button
- Click on PIN
- Select Digital and GP13
- Turn slider to switch
- Click on the back button
Arduino IDE and connections
1.Connect your NodeMCU to your PC
2. Open Arduino IDE
3. Then go to File->Examples->Blynk-Boards_Wifi->Esp8266Standalone
4. Select the correct board (NodeMCU 1.0) and the com port from the Tools Menu
5. Change the credentials to yours. If you don't know them, ask the admins. The auth[] is the key that you received previously on your email. The ssid[] is the name of your WiFi network and the pass[] is the password.
char auth[] = "????????????";
char ssid[] = "XXXXXXXXXX";
char pass[] = "YYYYYYYYYYY";
Finally Save the file and Press Upload.
Also, make the necessary connections to your circuit:
Now go back to your mobile press Play and......play with the button in Blynk!