In this lesson, we will use Mobile to control our robot car and make an imitation driving. Since is a mock driving, we will use a virtual steering wheel and gear in our APP to imitate their counterparts in real car.
You must complete lesson 2 Basic Movement before you continue on with this lesson.
If you don’t complete the frame of car, please review lesson 1
If you don’t complete the basic wire connection, please review lesson 2
Connection:
Insert Bluetooth Module (VCC,GND,D2,D3) into OSOYOO motor shield as following graph (Remember: DO NOT remove any existing wires installed in Lesson2):
Open-source Arduino Software(IDE) |
Download Arduino IDE here: https://www.arduino.cc/en/Main/Software?setlang=en |
|
7 zip is a free zip utility that un-zips zip files |
Download 7zip here for free https://www.7-zip.org/ |
|
OSOYOO imitation driving Robot APP | Search “OSOYOO imitation driving” in Google Play or Apple APP store |
Download https://osoyoo.com/driver/2022008400/lesson4.zip , unzip it, you will see a folder called lesson4
Connect UNO R3 board to PC with USB cable, open IDE, choose corresponding board/port for your project.
Notice: Shut off your battery or Unplug your power adapter when upload sketch code to OSOYOO Basic Board for Arduino.
Click file -> click Open -> choose code “lesson4.ino”, load the code into OSOYOO Basic Board for Arduino, and then upload the sketch to the board.
Notice: Servo Alignment
Please change the default value 90 in the following line as the FRONT value in the option 2 in Step 5 of lesson2. If you align the wheel direction manually as the option 1 in Step 5 of lesson2, please skip this step.
#define FRONT 90 // steering to front
1) Install APP on Android device as following
In Google Play store search APP name “OSOYOO imitation driving”, download the APP as following and install it in your smart phone
If you can not use Google Play to find the APP, please Download the APP from following link :https://osoyoo.com/driver/v1car.apk.
2) Install APP on Apple IOS device as following
In Apple APP store search APP name “OSOYOO imitation driving”, download the APP as following and install it in your smart phone
Now you have installed your hardware and software for this lesson, let’s drive our car!
Step 1)Put your robot car onto the ground and turn on the battery switch.
Step 2)Go to your mobile phone ->Setting ->Bluetooth setting and search a Bluetooth device called HC-02, pair it with code 1234
Step 3)Open OSOYOO imitation driving Robot APP, Click BT Search button and find the bluetooth you have paired
Step 4)Turn on Engine toggle, click Speed+ to make the robot speed up as the robot car is very slow at first. When you rotate your mobile phone angle, your car will change direction.
Enjoy your driving!
DownLoad Url osoyoo.com