Exercise 27 - WefaaRobotics/Smorphi GitHub Wiki

Items needed:

  • A computer
  • A USB to USB-C cable
  • Internet connection
  • An assembled Smorphi mini /Smorphi 2 robot
  • Blynk account

Objectives of exercise:

  1. Learn about Blynk
  2. Learn how to control Smorphi using Blynk

Steps Description
1 Firstly, go to your Blynk website and click “Quickstart Template”.



2 Next, go to “Datastreams” and click on the “edit” button.

Then, click on “New Datastream” and choose Virtual Pin.


Change the virtual pin number and Data Type to string.


3 Go on your phone, download the Blynk IoT app and log in.

4 After logging in, press on your quickstart device and press the wrench.

Drag and drop the joystick and click on it in order to go to advanced mode and click the datastream “joystick advance v3”(The virtual pin name created earlier).


5 [Some important things to change in Arduino]

Make sure the arduino "Tools" settings are as as follows:
* Make sure the flash frequency is in 40MHz
* CPU Frequency is in 240MHz
* The flash mode in “QOUT”
* Flash Size is in 4MB
* Partition Scheme is in Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS)



6 [Coordinates code]

You can try out first and once you are done, you can compare your solutions here.

7 Open Arduino Serial Monitor. We can now see all the coordinates being printed on the serial monitor for the Blynk joystick. By obtaining the joystick range value, you can understand the digital values of the joystick that are transmitted when you use the joystick to rotate between 0 to 360 degrees (in 2D space). For this exercise, the joystick range has already been set.

8 [Challenge]
Programme a code to control Smorphi using the Blynk joystick and reach the end. Test your knowledge of coding!!



If you struggle to figure out the code, Hint: First code out all the functions/ logic(Pseudocode), then try to compare your solution here

9 [Second Challenge]
With the Joystick code, add more functions and make Smorphi 2 change shapes.

You can try out first and once you are done, you can compare your solutions here.

10 You, can also add additional functionality of turning the robot clockwise and anticlockwise using the buttons on Blynk interface.

⚠️ **GitHub.com Fallback** ⚠️