![Keywish Hummer-Bot-1.0 Скачать руководство пользователя страница 99](http://html.mh-extra.com/html/keywish/hummer-bot-1-0/hummer-bot-1-0_instruction-manual_1962646099.webp)
96
#include "protocol.h"
#include "hummerbot.h"
#include "process.h"
int
E1
=
5
;
//PWMA
int
M1
=
9
;
//DIRA --- left
int
E2
=
6
;
//PWMB
int
M2
=
10
;
//DIRB --- right
byte readbuff
[
32
]
=
{};
int
readlen
=
0
;
ST_protocol recv
;
hummerbot hbot
(
E1
,
M1
,
E2
,
M2
,
13
,
A0
);
void
setup
()
{
Serial
.
begin
(
9600
);
hbot
.
init
();
}
void
read_data
(
void
)
{
unsigned
char
avilable
;
byte
*
p
=
readbuff
;
memset
(
p
,
0
,
32
);
readlen
=
0
;
while
(
Serial
.
available
()
>
0
)
{
if
(
!
avilable
&&
Serial
.
peek
()
==
START_CODE
)
{
avilable
=
1
;
}
if
(
avilable
)
{
if
((
*
p
=
Serial
.
read
())
==
END_CODE
)
{
avilable
=
0
;
readlen
++;
//Serial.print(*p,HEX);
break
;
}
//Serial.print(*p,HEX);
p
++;
readlen
++;
}
}
// Serial.print("\n");
}
void
loop
()
{
read_data
();
Содержание 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 ...