Define pins
This commit is contained in:
parent
6a43957bd6
commit
7691378312
20
car.ino
20
car.ino
@ -5,21 +5,21 @@
|
||||
|
||||
/* Define your pins here */
|
||||
/* Wheels */
|
||||
const int left_wheel_1 = 0;
|
||||
const int left_wheel_2 = 1;
|
||||
const int right_wheel_1 = 2;
|
||||
const int right_wheel_2 = 3;
|
||||
#define left_wheel_1 0
|
||||
#define left_wheel_2 1
|
||||
#define right_wheel_1 2
|
||||
#define right_wheel_2 3
|
||||
|
||||
/* Ultrasonic sensor */
|
||||
const int sensor_echo = 9;
|
||||
const int sensor_trigger = 10;
|
||||
#define sensor_echo 9
|
||||
#define sensor_trigger 10
|
||||
|
||||
/* Other constans */
|
||||
const int move_delay = 500;
|
||||
const int turn_delay = 500;
|
||||
#define move_delay 500
|
||||
#define turn_delay 500
|
||||
|
||||
/* disconnected pin for random seed */
|
||||
const int analog_disconnected = 0;
|
||||
#define analog_disconnected 0
|
||||
|
||||
/* Initialize sensor class */
|
||||
HCSR04 hcsr04(sensor_trigger, sensor_echo, 20, 4000);
|
||||
@ -137,7 +137,7 @@ int get_distance() {
|
||||
he must do the following actions:
|
||||
|
||||
* stop the wheels
|
||||
* turn on wheels to go backward for 1 second
|
||||
* turn on wheels to go backward
|
||||
* stop wheels
|
||||
* turn left or right
|
||||
* then go forward
|
||||
|
Loading…
Reference in New Issue
Block a user