PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Simple-Libraries
Learn
Simple Libraries
Robotics
ActivityBot
libabdrive
encoderLeds.c
1
#include "
abdrive.h
"
2
3
static
int
*cog;
4
5
void
abd_senseEncoders();
6
7
int
*encoderLeds_start(
int
pinLeft,
int
pinRight)
8
{
9
cog =
cog_run
(abd_senseEncoders, 128);
10
return
cog;
11
}
12
13
void
encoderLeds_stop()
14
{
15
cog_end
(cog);
16
}
17
18
void
abd_senseEncoders()
19
{
20
low
(26);
21
low
(27);
22
while
(1)
23
{
24
set_output
(26,
input
(14));
25
set_output
(27,
input
(15));
26
}
27
}
low
void low(int pin)
Set an I/O pin to output-low.
Definition:
low.c:19
input
int input(int pin)
Set an I/O pin to input and return 1 if pin detects a high signal, or 0 if it detects low.
Definition:
input.c:19
cog_end
void cog_end(int *coginfo)
End function code running in another cog that was launched with cog_run.
Definition:
cogend.c:15
cog_run
int * cog_run(void(*function)(void *par), int stacksize)
Run a function's code in the next available cog (processor).
Definition:
cogrun.c:15
abdrive.h
This library takes care of encoder monitoring and servo signaling, and provides a simple set of funct...
set_output
void set_output(int pin, int state)
Set I/O pin output register bit to either 1 or 0.
Definition:
setOutput.c:19
Generated on Fri May 20 2022 16:48:04 for PropWare by
1.8.17