DIY and Program On APP
DIY and Program On APP
Introduction:
Preparation:
A Smart Robot Car V 4.0 (with battery)
1.First of all, please make sure that the Smart Robot Car 4.0 has uploaded
the program successfully. If not, please open the SmartRobotCarV4.0 file in
the folder and then click the program SmartRobotCarV4.0.ino to upload.
After uploading successfully, please turn the“Upoad-Cam”button to“Cam”
and then turn on the power of the car.
2.Turn on the phone to connect to the WiFi hotspot opened by the wifi
module on the car. ( As shown in the figure, the name of the car’s WiFi
hotspot would be :ELEGOO-XXXXXXXXXXXXX(a string of numbers), this string
of numbers is a unique ID of the car, just like our ID card number.)
3.After the WiFi has been connected successfully, we can open our
supporting APP.
EleRobot
4.Enter the menu interface, and we need to first make sure that the
current interface is the control interface of SmartRobotCar .
Now you can click the green button and you will see
the car execute your instruction in sequence.
2 DIY Mode
In the DIY mode, we can design our own buttons to send customized
messages to the car. At the same time, we can also write a program through
Arduino software and upload it to the car according to our customized
information, so that the car can perform corresponding operations based
on the messages we send.
1.Select“DIY”on the menu interface. (First of all, you need to make sure
that WiFi is connected.)
We can set the button by long press.
Information Bar
We can click
Clear information this icon
to see the
project you
create
When the setting is finished, please press the keys in sequence, and if
we receive the return message (as shown in the following figure), it means
the DIY setting is successful.
3.Now, let’s program a simple example depends on the DIY function.
Mobile phone
Serial
Device wifi
ESP32 wifi
Device Serial
5.We need to process the data {Message} received by the serial port to
get Message.
int SerialPortDataAnalysis(void)
Serial.available():return to the serial buffer, the current number of
characters remaining in the buffer of the serial port. This function is
generally used to determine if there is data in the buffer of the serial port.
Serial.read(): take out and read a Byte data from the buffer of the
serial port.
6.After we parse out the key command information, we can operate our
car to perform different operations based on different information.
In our example in this lesson, we change the color of the colored lights on
the car by sending different information: {1}, {2}, {3} and {4}.
If you don't know how to change the color of the light, you can go back and
read the Demo5 review in Lesson 7 to find out.
Of course, you can also make the car achieve the function you want
according to your own ideas.
void Event()
Click the button 1, 2, 3 and 4 to send message {1}, {2}, {3} and {4}. The car
will change the color of the LED light according to the messages sent by
different buttons.
http://www.elegoo.com