eBoard ๐Ÿ‰  โ‘ โ‘งโ‘จ
Written for SIA 2017/2018
SoccerBoard Struct Reference

[COPY&PASTE] This is the SoccerBoard ghost struct :D More...

#include <eagle_SoccerBoard.h>

Public Member Functions

 SoccerBoard (void)
 The constructor. More...
 
void motor (uint8_t id, int16_t val)
 As requested this is the ultimate shortcut ;) More...
 
void motorsOff (void)
 As requested this is the shortcut to disable the main motor. More...
 
void power (optVAL_t id, bool state)
 Set the state of a certain D-pin. More...
 
void powerOn (optVAL_t id)
 Set the state of a certain D-pin to HIGH. More...
 
void powerOff (optVAL_t id)
 Set the state of a certain D-pin to LOW. More...
 
void sleep (uint16_t t)
 Say goodnight! More...
 
void msleep (uint16_t t)
 Say goodnight! More...
 
bool digital (optVAL_t id)
 Reads a digital value from a pin. More...
 
optVAL_t analog (optVAL_t id)
 Reads an analog value from a pin. More...
 
void reset (void)
 Resets the Soccerboard if EBOARD_USE_RESET is set to true. More...
 

Detailed Description

[COPY&PASTE] This is the SoccerBoard ghost struct :D

Author
EagleoutIce
Note
Some calls like led-calls won't have any effect due to the hardware of the UNO
But they will work on the MEGA!

[COPY&PASTE] You can use this class like this:

#include <eBoard.h>
//manual: '#include "/path/to/eBoard.h"'
bool toggle = true;
int main() {
for(;;){
board.power(3,toggle);
toggle = !toggle;
}
}

Definition at line 45 of file eagle_SoccerBoard.h.

Constructor & Destructor Documentation

◆ SoccerBoard()

SoccerBoard::SoccerBoard ( void  )
inline

The constructor.

Note
Its important to mention the fact that there is nothing interesting about this ;D

Member Function Documentation

◆ analog()

optVAL_t SoccerBoard::analog ( optVAL_t  id)
inline

Reads an analog value from a pin.

Parameters
idThe id of the pin
Returns
returns the value read

Definition at line 256 of file eagle_SoccerBoard.h.

References readPin().

256 {return readPin(id,0);}
optVAL_t readPin(optVAL_t idx, bool dig=true)
read a digital state from an INPUTpin
+ Here is the call graph for this function:

◆ digital()

bool SoccerBoard::digital ( optVAL_t  id)
inline

Reads a digital value from a pin.

Parameters
idThe id of the pin
Returns
returns the value read

Definition at line 255 of file eagle_SoccerBoard.h.

References readPin().

255 {return readPin(id);}
optVAL_t readPin(optVAL_t idx, bool dig=true)
read a digital state from an INPUTpin
+ Here is the call graph for this function:

◆ motor()

void SoccerBoard::motor ( uint8_t  id,
int16_t  val 
)

As requested this is the ultimate shortcut ;)


Parameters
idset to
  • [DEFAULT]
    • 0 it will access the main Motor (accessed with I2CInOut otherwise)
    • 1 it will try to access the Servo with the lower ID
    • 2 it will try to access the Servo with the higher ID
  • [EBOARD_HELPCAR]
    • 0 it will access the main Motor
    • 1 it will acces the steering Motor
valthe value you wan't to send
  • [DFAULT]
    • if id = 0 : val has to be from -255 to 255. Dir will be decided by >0|<0
    • if id = 1|2: val has to be from 0 to 300
  • [EBOARD_HELPCAR]
    • val has to be from 0 to 255 | with id = 0; 90 means stop


◆ motorsOff()

void SoccerBoard::motorsOff ( void  )

As requested this is the shortcut to disable the main motor.

◆ msleep()

void SoccerBoard::msleep ( uint16_t  t)
inline

Say goodnight!

Parameters
ttime in milliseconds the UNO gets to sleep ;)

Definition at line 254 of file eagle_SoccerBoard.h.

Referenced by main().

254 {delay(t);}
+ Here is the caller graph for this function:

◆ power()

void SoccerBoard::power ( optVAL_t  id,
bool  state 
)
inline

Set the state of a certain D-pin.

Note
unlike the soccerboard you can (if SHIFT_REGISTER enabled) use pinIDs from 100 to 131 (if provided by SN74HC595) directly to set shift-register Pins
if you want to have e.g. 64 bits you can hack the specific code (shiftAll()) to your needs;)
Parameters
idThe id of the pin
stateThe state the pin should have

Definition at line 250 of file eagle_SoccerBoard.h.

References writePin().

Referenced by powerOff(), and powerOn().

250 {writePin(id,state);}
void writePin(optVAL_t idx, bool val)
write a boolean state to an output pin
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ powerOff()

void SoccerBoard::powerOff ( optVAL_t  id)
inline

Set the state of a certain D-pin to LOW.

Note
unlike the soccerboard you can (if SHIFT_REGISTER enabled) use pinIDs from 100 to 131 (if provided by SN74HC595) directly to set shift-register Pins
if you want to have e.g. 64 bits you can hack the specific code (shiftAll()) to your needs;)
shortcut for power(id, LOW)
Parameters
idThe id of the pin

Definition at line 252 of file eagle_SoccerBoard.h.

References power().

252 {this->power(id,0);}
void power(optVAL_t id, bool state)
Set the state of a certain D-pin.
+ Here is the call graph for this function:

◆ powerOn()

void SoccerBoard::powerOn ( optVAL_t  id)
inline

Set the state of a certain D-pin to HIGH.

Note
unlike the soccerboard you can (if SHIFT_REGISTER enabled) use pinIDs from 100 to 131 (if provided by SN74HC595) directly to set shift-register Pins
if you want to have e.g. 64 bits you can hack the specific code (shiftAll()) to your needs;)
shortcut for power(id, HIGH)
Parameters
idThe id of the pin

Definition at line 251 of file eagle_SoccerBoard.h.

References power().

251 {this->power(id,1);}
void power(optVAL_t id, bool state)
Set the state of a certain D-pin.
+ Here is the call graph for this function:

◆ reset()

void SoccerBoard::reset ( void  )
inline

Resets the Soccerboard if EBOARD_USE_RESET is set to true.

◆ sleep()

void SoccerBoard::sleep ( uint16_t  t)
inline

Say goodnight!

Parameters
ttime in seconds the UNO gets to sleep ;)

Definition at line 253 of file eagle_SoccerBoard.h.

Referenced by main().

253 {delay(1000*t);}
+ Here is the caller graph for this function:

The documentation for this struct was generated from the following file: