Data hosted with ♥ by
Pastebin.com
-
Download Raw
-
See Original
#include <ipst.h>
int
i
=
0
;
char
x
[
20
]
;
void
setup
(
)
{
glcdMode
(
1
)
;
out
(
17
,
0
)
;
delay
(
100
)
;
out
(
17
,
1
)
;
delay
(
1000
)
;
Serial1.
begin
(
2400
)
;
Serial1.
print
(
"!SCSBR"
)
;
Serial1.
write
(
1
)
;
Serial1.
write
(
0x0D
)
;
delay
(
100
)
;
Serial1.
begin
(
38400
)
;
}
void
loop
(
)
{
for
(
i
=
0
;
i
<
16
;
i
++
)
{
servoWrite
(
i,
1250
)
;
}
delay
(
1000
)
;
for
(
i
=
0
;
i
<
16
;
i
++
)
{
servoWrite
(
i,
250
)
;
}
delay
(
1000
)
;
}
void
servoWrite
(
byte CH,
int
POS
)
{
byte L,H
;
Serial1.
print
(
"!SC"
)
;
Serial1.
write
(
CH
)
;
Serial1.
write
(
0x00
)
;
L
=
lowByte
(
POS
)
;
H
=
highByte
(
POS
)
;
Serial1.
write
(
L
)
;
Serial1.
write
(
H
)
;
Serial1.
write
(
0x0D
)
;
}