PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Simple-Libraries
Learn
Simple Libraries
Robotics
Arlo
libarlodrive
drive_getTicks.c
1
#include "
simpletools.h
"
2
#include "arlodrive.h"
3
#include "
fdserial.h
"
4
5
fdserial
*ard_dhb10_arlo;
6
fdserial
*term;
7
8
int
ard_offset, ard_increment, ard_cycles;
9
10
int
ard_rampStep;
11
int
ard_speedLimit;
12
int
ard_tRampStepPrev;
13
int
ard_speedL, ard_speedR;
14
int
ard_mode;
15
int
ard_feedback;
16
int
ard_servo_pin_L;
17
int
ard_servo_pin_R;
18
int
ard_opened;
19
int
ard_speedAccLim;
20
char
dhb10_reply[DHB10_LEN];
21
int
ard_ramp_interval;
22
23
char
*
drive_getTicks
(
int
*left,
int
*right)
24
{
25
#ifdef ARLO_DEBUG
26
dprint
(term,
"drive_getDist("
);
27
#endif
28
char
*reply = dhb10_reply;
29
if
(!ard_opened) drive_open();
30
reply = dhb10_com(
"dist\r"
);
31
sscan
(dhb10_reply,
"%d%d"
, left, right);
32
#ifdef ARLO_DEBUG
33
dprint
(term,
"%d, %d)\n"
, *left, *right);
34
#endif
35
return
reply;
36
}
37
drive_getTicks
void drive_getTicks(int *left, int *right)
Get the measured number of ticks the have traveled.
Definition:
getticks.c:9
dprint
int dprint(text_t *device, const char *format,...) __attribute__((format(printf
Print format "..." args to the device The output is limited to 256 bytes.
simpletools.h
This library provides convenient functions for a variety of microcontroller I/O, timing,...
text_struct
Structure that contains data used by simple text device libraries.
Definition:
simpletext.h:81
fdserial.h
This library supports creating and managing one or more full duplex serial connections with periphera...
sscan
int int int int sscan(const char *buffer, const char *fmt,...) __attribute__((format(printf
Convert formatted buffer to the "..." args.
Generated on Fri May 20 2022 16:48:04 for PropWare by
1.8.17