eBoard ①⑧⑨
Written for SIA 2017/2018
SoccerBoard Struct Reference

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

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!

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

◆ 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

◆ motor()

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

As requested this is the ultimate shortcut ;)


Note
EBOARD_DRIVE_ZERO for initial speed


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 ;)

Referenced by main().

+ 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

◆ 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

◆ 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

◆ 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 ;)

Referenced by main().

+ Here is the caller graph for this function:

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