1 #ifndef EAGLE_EBOARD_HELPLIB_SOCCERBOARD 2 #define EAGLE_EBOARD_HELPLIB_SOCCERBOARD 52 #if EBOARD_USE_UTILITY > 0x0 or defined(__AVR_ATmega2560__) //won't shrink space... just speed things up 61 inline void led(
int idx,
bool state);
69 inline void ledOn(
int idx);
77 inline void ledOff(
int idx);
83 inline void ledsOff(
void);
89 inline void ledMeter(
int);
92 #if EBOARD_USE_UTILITY > 0x0 93 inline void button(
int);
96 inline void waitForButton(
int);
119 void motor(uint8_t
id,int16_t val);
162 inline void sleep(uint16_t t);
168 inline void msleep(uint16_t t);
186 inline void reset(
void);
197 #if defined(__AVR_ATmega2560__) 198 inline void SoccerBoard::led(
int idx,
bool state) {
writePin(13,state);}
199 void SoccerBoard::ledOn(
int) {
writePin(13,HIGH);}
200 void SoccerBoard::ledOff(
int) {
writePin(13,LOW);}
201 void SoccerBoard::ledsOff(
void) {
writePin(13,LOW);}
202 void SoccerBoard::ledMeter(
int) {
writePin(13,HIGH);}
203 #elif EBOARD_USE_UTILITY > 0x0 204 void SoccerBoard::led(
int,
bool) {}
205 void SoccerBoard::ledOn(
int) {}
206 void SoccerBoard::ledOff(
int) {}
207 void SoccerBoard::ledsOff(
void) {}
208 void SoccerBoard::ledMeter(
int) {}
211 #if EBOARD_USE_UTILITY > 0x0 212 void SoccerBoard::button(
int) {}
213 void SoccerBoard::waitForButton(
int) {}
218 #if EBOARD_USE_RESET > 0x0 219 wdt_enable(WDTO_15MS);
225 #ifndef EBOARD_HELPCAR 230 if(val < 0 || val > 180)
return;
234 if(val < 0 || val > 180)
return;
241 #ifndef EBOARD_HELPCAR void writePWM(optVAL_t val)
write a clamped pwm value to an output pin
SoccerBoard(void)
The constructor.
This is the SoccerBoard ghost struct :D.
void write(int value)
sets angle or pulse width of the Servo
void powerOn(optVAL_t id)
Set the state of a certain D-pin to HIGH.
void reset(void)
Resets the Soccerboard if EBOARD_USE_RESET is set to true.
void sleep(uint16_t t)
Say goodnight!
void writePin(optVAL_t idx, bool val)
write a boolean state to an output pin
void msleep(uint16_t t)
Say goodnight!
void motorsOff(void)
As requested this is the shortcut to disable the main motor.
void motor(uint8_t id, int16_t val)
As requested this is the ultimate shortcut ;)
bool digital(optVAL_t id)
Reads a digital value from a pin.
void power(optVAL_t id, bool state)
Set the state of a certain D-pin.
optVAL_t readPin(optVAL_t idx, bool dig=true)
read a digital state from an INPUTpin
void write(int ID, int Pos)
Moves a Servo to a certain position.
optVAL_t analog(optVAL_t id)
Reads an analog value from a pin.
ServoCds55 _servoHandler
this is the "to_use" instance of ServoCds55
void powerOff(optVAL_t id)
Set the state of a certain D-pin to LOW.