PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Simple-Libraries
Learn
Simple Libraries
Robotics
ActivityBot360
libabcalibrate360
cal_getEepromPins.c
1
#include "
abcalibrate360.h
"
2
#include "
simpletools.h
"
3
#include "
servo360.h
"
4
//#include "abdrive360.h"
5
6
7
int
cal_getEepromPins()
8
{
9
int
eeAddr =
_AB360_EE_Start_
+ _AB360_EE_Pins_;
10
unsigned
char
pinInfo[16];
11
12
for
(
int
i = 0; i < 16; i++)
13
{
14
pinInfo[i] =
ee_getByte
(eeAddr + i);
15
/*
16
if(pinInfo[i] <= 'z' && pinInfo[i] >= ' ')
17
{
18
print("%c", pinInfo[i]);
19
}
20
else
21
{
22
print("[%d]", pinInfo[i]);
23
}
24
*/
25
}
26
27
print
(
"I/O pins\r"
);
28
print
(
"===================================\r"
);
29
print
(
"Control pins:\r"
);
30
print
(
"-----------------------------------\r"
);
31
32
if
(pinInfo[0] ==
's'
&& pinInfo[1] ==
'p'
&& pinInfo[2] ==
'L'
&& pinInfo[5] ==
'R'
)
33
{
34
//abd360_pinCtrlLeft = (int) pinInfo[3];
35
//abd360_pinCtrlRight = (int) pinInfo[6];
36
print
(
"Left servo: P%d\r"
, pinInfo[3]);
37
print
(
"right servo: P%d\r"
, pinInfo[6]);
38
}
39
//
40
else
41
{
42
print
(
"Control pin settings not found. Defaults of \r"
);
43
print
(
"P12 (left) and P13 (right) will be used. \r"
);
44
}
45
//
46
47
pause
(50);
48
print
(
"\rFeedback pins:\r"
);
49
print
(
"-----------------------------------\r"
);
50
if
(pinInfo[8] ==
'e'
&& pinInfo[9] ==
'p'
&& pinInfo[10] ==
'L'
&& pinInfo[13] ==
'R'
)
51
{
52
//abd360_pinFbLeft = (int) pinInfo[11];
53
//abd360_pinFbRight = (int) pinInfo[14];
54
print
(
"Left servo: P%d\r"
, pinInfo[11]);
55
print
(
"right servo: P%d\r"
, pinInfo[14]);
56
}
57
//
58
else
59
{
60
print
(
"Feedback pin settings not found. Defaults of \r"
);
61
print
(
"P14 (left) and P15 (right) will be used. \r\r"
);
62
}
63
//print("===================================\r\r");
64
}
65
66
67
ee_getByte
char ee_getByte(int addr)
Get a byte value from a certain address in the Propeller Chip's dedicated EEPROM.
Definition:
eeprom_getByte.c:24
abcalibrate360.h
This library has a functions you can call to calibrate your ActivityBot 360. Example code that uses t...
pause
void pause(int time)
Delay cog from moving on to the next statement for a certain length of time.
Definition:
libws2812.c:125
_AB360_EE_Start_
#define _AB360_EE_Start_
ActivityBot EEPROM calibration data start address.
Definition:
abcalibrate360.h:68
simpletools.h
This library provides convenient functions for a variety of microcontroller I/O, timing,...
print
int print(const char *format,...) __attribute__((format(printf
Print format "..." args to the default simple terminal device. The output is limited to 256 bytes.
servo360.h
Parallax Feedback 360 High Speed Servo control and monitoring functions. Uses one additional cog to c...
Generated on Fri May 20 2022 16:48:04 for PropWare by
1.8.17