![Keywish Hummer-Bot-1.0 Скачать руководство пользователя страница 63](http://html.mh-extra.com/html/keywish/hummer-bot-1-0/hummer-bot-1-0_instruction-manual_1962646063.webp)
60
int
E1
=
5
;
//PWMA
int
M1
=
9
;
//DIRA****************************************left
int
E2
=
6
;
//PWMB
int
M2
=
10
;
//DIRB****************************************right
/*Define 4 motor control terminals, connected to IN1-IN4 on the motor drive board.*/
void setup
()
{
Serial
.
begin
(
9600
);
/*Set the baud rate to 9600 */
}
void loop
()
{
int
left1
,
centre
,
right1
;
/*Define 3 sensors */
left1
=
analogRead
(
A0
);
centre
=
analogRead
(
A1
);
right1
=
analogRead
(
A2
);
/*Read the value collected by 3 sensors */
if
((
right1
>=
975
)
&&
(
centre
<=
8
)
&&
(
left1
>=
975
))
{
/* Judge the collected value, if right1 >
the sensor captures a value that is low and reads 0 after analog IO. However, to reduce the error,
we set the threshold In 8, to prevent the error caused by the car to determine the wrong, we can
Содержание Hummer-Bot-1.0
Страница 1: ...Hummer Bot 1 0 Instruction Manual V 2 0 ...
Страница 18: ...15 Step4 You need to install motors Figure 3 1 5 Schematic diagram of motor installation ...
Страница 50: ...47 Figure 3 2 15 Diagram of Data without Obstacles ...
Страница 83: ...80 Test code Path hummer bot Lesson ModuleDemo IrkeyPressed IrkeyPressed ino ...