1 #ifndef EAGLE_EBOARD_HELPLIB_SOCCERBOARD 2 #define EAGLE_EBOARD_HELPLIB_SOCCERBOARD 35 #if EBOARD_USE_UTILITY > 0x0 or defined(__AVR_ATmega2560__) //won't shrink space... just speed things up 44 inline void led(
int idx,
bool state);
52 inline void ledOn(
int idx);
60 inline void ledOff(
int idx);
66 inline void ledsOff(
void);
72 inline void ledMeter(
int);
75 #if EBOARD_USE_UTILITY > 0x0 76 inline void button(
int);
79 inline void waitForButton(
int);
91 inline void motor(uint8_t
id,int16_t val);
134 inline void sleep(uint16_t t);
140 inline void msleep(uint16_t t);
158 inline void reset(
void);
163 #if defined(__AVR_ATmega2560__) 164 inline void SoccerBoard::led(
int idx,
bool state) {
writePin(13,state);}
165 void SoccerBoard::ledOn(
int) {
writePin(13,HIGH);}
166 void SoccerBoard::ledOff(
int) {
writePin(13,LOW);}
167 void SoccerBoard::ledsOff(
void) {
writePin(13,LOW);}
168 void SoccerBoard::ledMeter(
int) {
writePin(13,HIGH);}
169 #elif EBOARD_USE_UTILITY > 0x0 170 void SoccerBoard::led(
int,
bool) {}
171 void SoccerBoard::ledOn(
int) {}
172 void SoccerBoard::ledOff(
int) {}
173 void SoccerBoard::ledsOff(
void) {}
174 void SoccerBoard::ledMeter(
int) {}
177 #if EBOARD_USE_UTILITY > 0x0 178 void SoccerBoard::button(
int) {}
179 void SoccerBoard::waitForButton(
int) {}
184 else if(
id>0&&
id<3&&(val>-0 && val < 1024)) {_servoHandler.write((
id-1),(val *600/1023 - 300));}
189 #if EBOARD_USE_RESET > 0x0 190 wdt_enable(WDTO_15MS);
void writePWM(optVAL_t val)
write a clamped pwm value to an output pin
SoccerBoard(void)
The constructor.
[COPY&PASTE] This is the SoccerBoard ghost struct :D
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
optVAL_t analog(optVAL_t id)
Reads an analog value from a pin.
void powerOff(optVAL_t id)
Set the state of a certain D-pin to LOW.