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

[I2C] [LCD] This is used to add support for OLED displays connected to the 'SoccerBoard' More...

#include <eagle_LCD.h>

Public Member Functions

 LCD (SoccerBoard &soccerBoard, optVAL_t id=0x3C)
 The constructor. More...
 
bool changeID (optVAL_t newID=0x3C)
 changes the address of the LCD display talked to More...
 
bool clear (void)
 clears the LCD More...
 
void print (const char *data)
 prints a string to the display More...
 
void print (int data)
 prints an integer to the display More...
 
void print (optVAL_t line, optVAL_t col, const char *data)
 prints a string to the display at a specific position More...
 
void print (optVAL_t line, optVAL_t col, int data)
 prints an integer to the display at a specific position More...
 
void lightOn (void)
 enable the backlight More...
 
void lightOff (void)
 disable the backlight More...
 
bool reset (void)
 clears the screen More...
 
bool init (void)
 initializes the Display called by: More...
 
void drawBitmap (const unsigned char *bitmap, byte posX, byte posY, byte hiX, byte hiY)
 draws a bitmap representet as an array of bytes More...
 
void changeMode (bool newMode=true)
 enable or disable the display More...
 
bool setCursor (byte posX=0x0, byte posY=0x0)
 set the position of the cursor More...
 
bool changeBrightness (byte val=0x64)
 changes the brightness of the display More...
 
void changeBackground (bool newBackground=false)
 changes the background of the display More...
 

Public Attributes

optVAL_t ID
 ID of the Display. More...
 

Private Member Functions

void s2Cmd (optVAL_t o, optVAL_t t)
 this function will execute two cmd sends without starting and without ending the transmission More...
 
bool s1Cmd (optVAL_t o)
 this function will execute one cmd send without starting and without ending the transmission More...
 
void s1Dat (optVAL_t o)
 this function will execute one dat send without starting and without ending the transmission More...
 

Private Attributes

byte pX
 the addressing mode (page/horizontal) More...
 
byte pY
 posY More...
 
bool _cI
 called_guard More...
 

Detailed Description

[I2C] [LCD] This is used to add support for OLED displays connected to the 'SoccerBoard'

Author
EagleoutIce

LCD refers to the connected OLED display

Warning
the usage of the LCD will need many Space due to the fact that font is handled by arduino
Precondition
to use this class:
#define EBOARD_I2C 0x1 //do you think this is obsolete ? tell me :D
#define EBOARD_LCD 0x1

[I2C] [LCD] You can use this class like this:

#define EBOARD_I2C 0x1
#define EBOARD_LCD 0x1
#include <eBoard.h>
//manual: '#include "/path/to/eBoard.h"'
int main() {
board.sleep(2); // not needed (it's just funny :P)
lcd.print("Hallo Mama,\n Wie gehts'?");
lcd.print(2,2,"-- Gut");
lcd.print(3,0,42);
}
Note
positions will only apply if both of them are smaller as the maximum declared with LCD_HEIGHT and LCD_WIDTH
init() will be called on the first display access! [Version 2.2b 🦍 - Optimize it [52m]]

Definition at line 203 of file eagle_LCD.h.

Constructor & Destructor Documentation

◆ LCD()

LCD::LCD ( SoccerBoard soccerBoard,
optVAL_t  id = 0x3C 
)

The constructor.

Parameters
soccerBoardthe connected SoccerBoard object
idthe ID of the LCD display. Can be identified via pingI2C()
Note
if EBOARD_NANO is set to 0x1 this will only take one argument [the id]

Member Function Documentation

◆ changeBackground()

void LCD::changeBackground ( bool  newBackground = false)

changes the background of the display

Parameters
newBackgroundthe new background of display
  • true: white
  • false: black

Referenced by main().

+ Here is the caller graph for this function:

◆ changeBrightness()

bool LCD::changeBrightness ( byte  val = 0x64)

changes the brightness of the display

Parameters
valthe new brightness of display
Returns
true if the transmission was successful
false if there was one of the following errors:
  • buffer overflow
  • NACK on address
  • NACK on data
  • unknown error

◆ changeID()

bool LCD::changeID ( optVAL_t  newID = 0x3C)

changes the address of the LCD display talked to

Parameters
newIDthe target ID of the LCD
Note
this calls LCD::init() by default!
Returns
true if the transmission was successful
false if there was one of the following errors:
  • buffer overflow
  • NACK on address
  • NACK on data
  • unknown error

◆ changeMode()

void LCD::changeMode ( bool  newMode = true)

enable or disable the display

Parameters
newModethe mode the Display should have now
  • true: enabled
  • false: disabled

◆ clear()

bool LCD::clear ( void  )

clears the LCD

Returns
true if the transmission was successful
false if there was one of the following errors:
  • buffer overflow
  • NACK on address
  • NACK on data
  • unknown error

Referenced by main().

+ Here is the caller graph for this function:

◆ drawBitmap()

void LCD::drawBitmap ( const unsigned char *  bitmap,
byte  posX,
byte  posY,
byte  hiX,
byte  hiY 
)

draws a bitmap representet as an array of bytes

Parameters
bitmapthe array of bytes representing the bitmap to draw
posXthe startPos abscissa
posYthe startPos ordinate
hiXthe width of the bitmap
hiYthe height of the bitmap

Referenced by main().

+ Here is the caller graph for this function:

◆ init()

bool LCD::init ( void  )

initializes the Display called by:

Returns
true if the transmission was successful
false if there was one of the following errors:
  • buffer overflow
  • NACK on address
  • NACK on data
  • unknown error

◆ lightOff()

void LCD::lightOff ( void  )
inline

disable the backlight

This is similar to:

[LCD::]brightness(0);

◆ lightOn()

void LCD::lightOn ( void  )
inline

enable the backlight

This is similar with:

[LCD::]brightness(255);

◆ print() [1/4]

void LCD::print ( const char *  data)

prints a string to the display

Parameters
datathe string to print

Referenced by main().

+ Here is the caller graph for this function:

◆ print() [2/4]

void LCD::print ( int  data)

prints an integer to the display

Parameters
datathe integer to print

◆ print() [3/4]

void LCD::print ( optVAL_t  line,
optVAL_t  col,
const char *  data 
)

prints a string to the display at a specific position

Parameters
linethe line to start at
colthe col to start at
datathe string to print

◆ print() [4/4]

void LCD::print ( optVAL_t  line,
optVAL_t  col,
int  data 
)

prints an integer to the display at a specific position

Parameters
datathe integer to print [if you want to apply precision you'll have to do it manually there is no float write to save memory]
linethe line to start at
colthe col to start at

◆ reset()

bool LCD::reset ( void  )

clears the screen

Returns
true if the transmission was successful
false if there was one of the following errors:
  • buffer overflow
  • NACK on address
  • NACK on data
  • unknown error

◆ s1Cmd()

bool LCD::s1Cmd ( optVAL_t  o)
private

this function will execute one cmd send without starting and without ending the transmission

Parameters
othe param
Returns
true if the transmission was successful
false if there was one of the following errors:
  • buffer overflow
  • NACK on address
  • NACK on data
  • unknown error

◆ s1Dat()

void LCD::s1Dat ( optVAL_t  o)
private

this function will execute one dat send without starting and without ending the transmission

Parameters
othe param

◆ s2Cmd()

void LCD::s2Cmd ( optVAL_t  o,
optVAL_t  t 
)
private

this function will execute two cmd sends without starting and without ending the transmission

Parameters
othe first param
tthe second param

◆ setCursor()

bool LCD::setCursor ( byte  posX = 0x0,
byte  posY = 0x0 
)

set the position of the cursor

Parameters
posXthe new position abscissa
posYthe new position ordinate
Returns
true if the transmission was successful
false if there was one of the following errors:
  • buffer overflow
  • NACK on address
  • NACK on data
  • unknown error

Member Data Documentation

◆ _cI

bool LCD::_cI
private

called_guard

Definition at line 381 of file eagle_LCD.h.

◆ ID

optVAL_t LCD::ID

ID of the Display.

Definition at line 371 of file eagle_LCD.h.

◆ pX

byte LCD::pX
private

the addressing mode (page/horizontal)

posX

Definition at line 377 of file eagle_LCD.h.

◆ pY

byte LCD::pY
private

posY

Definition at line 379 of file eagle_LCD.h.


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