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

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

#include <eBoard.h>

Public Member Functions

 SoccerBoard (void)
 The constructor. More...
 
void led (int idx, bool state)
 [MEGA] Control the OnBoard LED More...
 
void ledOn (int idx)
 [MEGA] Activate the OnBoard LED More...
 
void ledOff (int idx)
 [MEGA] Deactivate the OnBoard LED More...
 
void ledsOff (void)
 [MEGA] Deactivate the OnBoard LED More...
 
void ledMeter (int)
 [MEGA] Activate the OnBoard LED More...
 
void button (int)
 ๐Ÿ”ง I prevent errors! More...
 
void waitForButton (int)
 ๐Ÿ”ง I prevent errors! 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 2809 of file eBoard.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

◆ button()

void SoccerBoard::button ( int  )
inline

๐Ÿ”ง I prevent errors!

◆ 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

◆ led()

void SoccerBoard::led ( int  idx,
bool  state 
)
inline

[MEGA] Control the OnBoard LED

Warning
this will take control over the Di13 pin on the MEGA
Parameters
idxthe index of the LED. Won't be checked always be assumed as 1
statethe state of the LED

◆ ledMeter()

void SoccerBoard::ledMeter ( int  )
inline

[MEGA] Activate the OnBoard LED

Warning
this will take control over the Di13 pin on the MEGA

◆ ledOff()

void SoccerBoard::ledOff ( int  idx)
inline

[MEGA] Deactivate the OnBoard LED

Warning
this will take control over the Di13 pin on the MEGA
Parameters
idxthe index of the LED. Won't be checked always be assumed as 1

◆ ledOn()

void SoccerBoard::ledOn ( int  idx)
inline

[MEGA] Activate the OnBoard LED

Warning
this will take control over the Di13 pin on the MEGA
Parameters
idxthe index of the LED. Won't be checked always be assumed as 1

◆ ledsOff()

void SoccerBoard::ledsOff ( void  )
inline

[MEGA] Deactivate the OnBoard LED

Warning
this will take control over the Di13 pin on the MEGA

◆ motor()

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

As requested this is the ultimate shortcut ;)

Parameters
idset to
  • 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
valthe value you wan't to send
  • 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 1023

◆ motorsOff()

void SoccerBoard::motorsOff ( void  )
inline

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:

◆ waitForButton()

void SoccerBoard::waitForButton ( int  )
inline

๐Ÿ”ง I prevent errors!


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