|
Edited by mmoraes80 at 2018-9-6 12:50 AM
Hi!
First of all, I would like to say that this Adeept Remote Control Smart Car kit is awesome and very educational from an Arduino® coding perspective. The assembly was very easy to follow and it took me about 1 hour to complete it (final assembly photo below). If you want to start learing how to code Arduino in a very fun way, I totally recommend this product.
I revised the attached code for the remote and the chassis and added some new features. I also commented every line so you can understand what it means / does.
> Revisions:
1. Chassis and Remote pin out definition-- There were a few wrong definitions in the code I downloaded and the car was not respoding properly. I reviewed each of them based on the schematics
2. FORWARD and BACKWARD variables
-- variables were defined twice with different HIGH/LOW values, causing issues on the Auto Mode
3. getDistance() function
-- added a analogWrite(trigPin, LOW) to guarantee a clean pulse
4. ctrlCar0 and ctrlCar1 functions
-- fixed minor logical errors due to FORWARD and BACKWARD variables
5. auto mode in void Loop()
-- added distance range and steering angle for distances between 50 cm and 80 cm
-- the auto mode code works fine but I am developing an improved code which I will share when it is done
6. ultrasonic sensor servo
-- removed servo offset variable since it was a fixed value
-- removed Pot6 (steering) adjustment, leaving it only for steering fine tuning
-- adjusted the center position to 100 degrees and sweeping angle from 40 to 160 degrees - this way the sensor middle position is completely aligned and perpendicular to the front of the vehicle allowing you to attach the plate
-- Please not that these angles are dependant of how you have assembled your sensor plate to the servo. You may want to try it out a few times to find the correct angle for your car
> Additions:
1. U1 Joystick Xaxis in data array
-- the code does not have any functionality for it yet, but the data is now being sent to the car for future operations
2. LED colors
-- added more colors based on RGB 0-255 combinations (7 colors plus OFF)
IMPORTANT: The remote control is based on an Arduino Nano board. When using Arduino IDE or Arduino Creator (Web), make sure you select the Nano board and ATmega328old bootloader, otherwise, the board will not sync and you will not be able to upload the code to it.
|
|