#include <uOLED.h>
Public Member Functions | |
uOLED (void) | |
Class constructor. | |
void | begin (int pin, long baud, HardwareSerial *serialToUse) |
Start and init screen. | |
void | PutPixel (char x, char y, int color) |
Draw a pixel. | |
void | Line (char x1, char y1, char x2, char y2, int color) |
Draw a line. | |
void | Rectangle (char x1, char y1, char x2, char y2, int color, char filled) |
Draw a rectangle. | |
void | Circle (char x, char y, char radius, int color, char filled) |
Draw a circle. | |
void | SetBackColor (int color) |
Set background color. | |
void | Triangle (char x1, char y1, char x2, char y2, char x3, char y3, int color, char filled) |
Draw a triangle. | |
void | CopyPaste (char xCopy, char yCopy, char xPaste, char yPaste, char Width, char Height) |
Copy and paste a rectangle on screen. | |
void | Character (char Character, char font, char col, char row, int color, char transparent) |
Place a character on the screen. | |
void | CharacterGraphic (char Character, char font, char col, char row, int color, char Width, char Height, char transparent) |
Place a scaled character on the screen. | |
void | Text (char col, char row, char font, int color, char *Text, char transparent) |
Place a string of characters on the screen. | |
void | TextGraphic (char col, char row, char font, int color, char Width, char Height, char *text, char transparent) |
Place a scaled string of characters on the screen. | |
void | TextButton (char state, char x, char y, int ButtonColor, char font, int TextColor, char TextWidth, char TextHeight, char *Text) |
To do. | |
void | AddBMPChar (char reference, char data1, char data2, char data3, char data4, char data5, char data6, char data7, char data8) |
To do. | |
void | PutBMPChar (char reference, char x, char y, int color) |
To do. | |
unsigned int | ReadPixel (char x, char y) |
To do. | |
void | Cls (void) |
To do. | |
void | DisplayControl (char Mode, char Value) |
To do. | |
void | SetContrast (char contrastValue) |
To do. | |
void | SetPowerState (char state) |
To do. | |
void | SetDisplayState (char state) |
To do. | |
void | DeviceInfo () |
To do. | |
void | scrollEnable (boolean enable) |
To do. | |
void | scrollToRight (boolean toRight) |
To do. | |
void | scrollSpeed (byte scrollSpeed) |
To do. | |
void | sdInit () |
To do. | |
void | sdSetMemAdrr (char Umsb, char Ulsb, char Lmsb, char Llsb) |
To do. | |
void | sdWriteByte (byte data) |
To do. | |
byte | sdReadByte (void) |
To do. | |
void | sdWriteBlock (long sector, byte data[]) |
To do. | |
void | sdReadBlock (long sector, byte data[]) |
To do. | |
void | sdScreenCopy (byte x, byte y, byte width, byte height, long sector) |
To do. | |
void | sdDisplayImage (byte x, byte y, byte width, byte height, boolean twoBytesPP, long sector) |
To do. | |
void | sdDisplayVideo (byte x, byte y, byte width, byte height, boolean twoBytesPP, byte fdelay, int frames, long sector) |
To do. | |
void | playTone (int tone, int duration) |
Generate a note or frequency for a certain duration. | |
void | playRtttl (char *song) |
To do. | |
Public Attributes | |
int | PinReset |
Pin that send Reset signal. | |
char | res |
Result for every command. | |
int | x_res |
width of display in pixels | |
int | y_res |
Height of display in pixels. | |
Private Member Functions | |
void | write (byte pData) |
Wrapper for writing to serial port. | |
void | begin (long BaudRate) |
Wrapper for Serial.begin(baudrate). | |
boolean | available (void) |
Wrapper for checking if there is something to read from the serial buffer. | |
int | read (void) |
Wrapper for reading from the serial port buffer. | |
void | SetFontSize (char font) |
Setting the fontsize to use. | |
void | TextMode (char mode) |
Setting opaque or transparent for text. | |
void | PenSize (char size) |
Draw an object solid or wire-frame. | |
char | RBack (void) |
Read back a character from the display. | |
void | DevInfoInVar (void) |
Asks the display for it's geometry. | |
Private Attributes | |
HardwareSerial * | pSerial |
Hardware serial port to use. |
Base uOLED class.
Base uOLED class with most functions from the manual
Definition at line 144 of file uOLED.h.
void uOLED::AddBMPChar | ( | char | reference, | |
char | data1, | |||
char | data2, | |||
char | data3, | |||
char | data4, | |||
char | data5, | |||
char | data6, | |||
char | data7, | |||
char | data8 | |||
) |
boolean uOLED::available | ( | void | ) | [private] |
void uOLED::begin | ( | long | BaudRate | ) | [private] |
void uOLED::begin | ( | int | pin, | |
long | baud, | |||
HardwareSerial * | serialToUse | |||
) |
Start and init screen.
begin takes 3 arguments.
void uOLED::Character | ( | char | Character, | |
char | font, | |||
char | col, | |||
char | row, | |||
int | color, | |||
char | transparent | |||
) |
Place a character on the screen.
Places one character on the screen with a fontsize (0x00, 0x01 or 0x02) using column and row as reference. Color or is a 16bit color and argument 'transparant' takes;
either blocked(opaque) (0x01) or transparent (0x00).
From datasheet for 160 by 128 pixels;
column : horizontal position of character:
range : 0 - 20 for 5x7 font.
range : 0 - 15 for 8x8 and 8x12 font.
row : vertical position of character:
range : 0 - 15 for 5x7 and 8x8 font.
range : 0 - 9 for 8x12 font.
void uOLED::CharacterGraphic | ( | char | Character, | |
char | font, | |||
char | col, | |||
char | row, | |||
int | color, | |||
char | Width, | |||
char | Height, | |||
char | transparent | |||
) |
Place a scaled character on the screen.
Place one scaled character on the screen with a chosen font (0x00, 0x01 or 0x02) referenced by column/row.
From datasheet for 160 by 128 pixels;
column : horizontal position of character:
range : 0 - 20 for 5x7 font.
range : 0 - 15 for 8x8 and 8x12 font.
row : vertical position of character:
range : 0 - 15 for 5x7 and 8x8 font.
range : 0 - 9 for 8x12 font.
With a 16bit color.
Width and Height are multipliers.
Example;
void uOLED::Circle | ( | char | x, | |
char | y, | |||
char | radius, | |||
int | color, | |||
char | filled | |||
) |
void uOLED::CopyPaste | ( | char | xCopy, | |
char | yCopy, | |||
char | xPaste, | |||
char | yPaste, | |||
char | Width, | |||
char | Height | |||
) |
void uOLED::DevInfoInVar | ( | void | ) | [private] |
void uOLED::DisplayControl | ( | char | Mode, | |
char | Value | |||
) |
void uOLED::Line | ( | char | x1, | |
char | y1, | |||
char | x2, | |||
char | y2, | |||
int | color | |||
) |
void uOLED::PenSize | ( | char | size | ) | [private] |
void uOLED::playRtttl | ( | char * | song | ) |
void uOLED::playTone | ( | int | tone, | |
int | duration | |||
) |
void uOLED::PutBMPChar | ( | char | reference, | |
char | x, | |||
char | y, | |||
int | color | |||
) |
void uOLED::PutPixel | ( | char | x, | |
char | y, | |||
int | color | |||
) |
char uOLED::RBack | ( | void | ) | [private] |
int uOLED::read | ( | void | ) | [private] |
unsigned int uOLED::ReadPixel | ( | char | x, | |
char | y | |||
) |
void uOLED::Rectangle | ( | char | x1, | |
char | y1, | |||
char | x2, | |||
char | y2, | |||
int | color, | |||
char | filled | |||
) |
Draw a rectangle.
Draw a rectangle with upper-left corner at x1,y1 and the bottom-right corner at x2,y2. Lines will have 16bit color. filled=true -> fill the rectangle with the color given.
Note that the sides of the rectangle can not be diagonal on the screen.
void uOLED::scrollEnable | ( | boolean | enable | ) |
void uOLED::scrollSpeed | ( | byte | scrollSpeed | ) |
void uOLED::scrollToRight | ( | boolean | toRight | ) |
void uOLED::sdDisplayImage | ( | byte | x, | |
byte | y, | |||
byte | width, | |||
byte | height, | |||
boolean | twoBytesPP, | |||
long | sector | |||
) |
void uOLED::sdDisplayVideo | ( | byte | x, | |
byte | y, | |||
byte | width, | |||
byte | height, | |||
boolean | twoBytesPP, | |||
byte | fdelay, | |||
int | frames, | |||
long | sector | |||
) |
void uOLED::sdReadBlock | ( | long | sector, | |
byte | data[] | |||
) |
void uOLED::sdScreenCopy | ( | byte | x, | |
byte | y, | |||
byte | width, | |||
byte | height, | |||
long | sector | |||
) |
void uOLED::sdSetMemAdrr | ( | char | Umsb, | |
char | Ulsb, | |||
char | Lmsb, | |||
char | Llsb | |||
) |
void uOLED::sdWriteBlock | ( | long | sector, | |
byte | data[] | |||
) |
void uOLED::sdWriteByte | ( | byte | data | ) |
void uOLED::SetBackColor | ( | int | color | ) |
void uOLED::SetContrast | ( | char | contrastValue | ) |
void uOLED::SetDisplayState | ( | char | state | ) |
void uOLED::SetFontSize | ( | char | font | ) | [private] |
void uOLED::SetPowerState | ( | char | state | ) |
void uOLED::Text | ( | char | col, | |
char | row, | |||
char | font, | |||
int | color, | |||
char * | Text, | |||
char | transparent | |||
) |
Place a string of characters on the screen.
Places a string of characters on the screen with a fontsize (0x00, 0x01 or 0x02) using column and row as reference for the first character. Maximum string size is 256 characters and the display will wrap around to the next row. Color or is a 16bit color and argument 'transparant' takes;
either blocked (0x01) or transparent (0x00).
From datasheet for 160 by 128 pixels;
column : horizontal position of first character:
range : 0 - 20 for 5x7 font.
range : 0 - 15 for 8x8 and 8x12 font.
row : vertical position of first character:
range : 0 - 15 for 5x7 and 8x8 font.
range : 0 - 9 for 8x12 font.
void uOLED::TextButton | ( | char | state, | |
char | x, | |||
char | y, | |||
int | ButtonColor, | |||
char | font, | |||
int | TextColor, | |||
char | TextWidth, | |||
char | TextHeight, | |||
char * | Text | |||
) |
void uOLED::TextGraphic | ( | char | col, | |
char | row, | |||
char | font, | |||
int | color, | |||
char | Width, | |||
char | Height, | |||
char * | text, | |||
char | transparent | |||
) |
Place a scaled string of characters on the screen.
Place a scaled string of characters on the screen with a chosen font (0x00, 0x01 or 0x02). First character referenced by column/row.
From datasheet for 160 by 128 pixels;
column : horizontal position of character:
range : 0 - 20 for 5x7 font.
range : 0 - 15 for 8x8 and 8x12 font.
row : vertical position of character:
range : 0 - 15 for 5x7 and 8x8 font.
range : 0 - 9 for 8x12 font.
With a 16bit color.
Width and Height are multipliers.
Example;
void uOLED::TextMode | ( | char | mode | ) | [private] |
void uOLED::Triangle | ( | char | x1, | |
char | y1, | |||
char | x2, | |||
char | y2, | |||
char | x3, | |||
char | y3, | |||
int | color, | |||
char | filled | |||
) |
void uOLED::write | ( | byte | pData | ) | [private] |
int uOLED::PinReset |
HardwareSerial* uOLED::pSerial [private] |
char uOLED::res |
int uOLED::x_res |
int uOLED::y_res |