42 #ifndef API_ROVER_DISPLAY_HPP_ 43 #define API_ROVER_DISPLAY_HPP_ 45 #include <drivers/oled_drivers/Adafruit_SSD1306.h> 121 void drawBitmap (int16_t x, int16_t y,
const uint8_t *bitmap, int16_t w, int16_t h, uint16_t color) ;
158 void print (
const char *
string);
169 void drawRect (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);
177 void drawPixel(int16_t x, int16_t y, uint16_t color);
186 void drawCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color);
195 void fillCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color);
205 void drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color);
222 void fillRoundRect(int16_t x, int16_t y, int16_t w, int16_t h, int16_t r, uint16_t color);
233 void drawRoundRect(int16_t x, int16_t y, int16_t w, int16_t h, int16_t r, uint16_t color);
245 void drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);
257 void fillTriangle ( int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);
268 void drawChar(int16_t x, int16_t y,
unsigned char c, uint16_t color, uint16_t bg, uint8_t size);
void initialize(void)
Initializes the OLED display of the rover.
Definition: rover_display.cpp:53
int16_t height(void)
Returns width of the display.
Definition: rover_display.cpp:400
void setTextSize(uint8_t s)
Sets the text size to one of the predefined sizes.
Definition: rover_display.cpp:142
Adafruit_SSD1306 & getDisplay(void)
Returns the display object.
Definition: rover_display.cpp:217
void drawPixel(int16_t x, int16_t y, uint16_t color)
Draws a pixel.
Definition: rover_display.cpp:230
void fillCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color)
Draws a filled circle.
Definition: rover_display.cpp:260
void drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color)
Draws a triangle.
Definition: rover_display.cpp:320
void fillRoundRect(int16_t x, int16_t y, int16_t w, int16_t h, int16_t r, uint16_t color)
Draws a filled rounded rectangle.
Definition: rover_display.cpp:305
void invertDisplay(boolean i)
Inverts the display.
Definition: rover_display.cpp:380
void fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color)
Draws a filled triangle.
Definition: rover_display.cpp:335
void drawCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color)
Draws a circle.
Definition: rover_display.cpp:245
void drawBitmap(int16_t x, int16_t y, const uint8_t *bitmap, int16_t w, int16_t h, uint16_t color)
Draws a bitmap on the OLED display.
Definition: rover_display.cpp:112
void drawRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color)
Draws a rectangle to OLED display.
Definition: rover_display.cpp:202
int16_t width(void)
Returns height of the display.
Definition: rover_display.cpp:395
static const int WHITE_COLOR
Static definition to indicate WHITE color.
Definition: rover_display.hpp:80
void drawRoundRect(int16_t x, int16_t y, int16_t w, int16_t h, int16_t r, uint16_t color)
Draws a rounded rectangle.
void drawChar(int16_t x, int16_t y, unsigned char c, uint16_t color, uint16_t bg, uint8_t size)
Used to draw a character.
Definition: rover_display.cpp:350
rover Namespace contains classes to manage Rover sensors, gpio, buzzer, buttons, driving, utilities, and cloud.
Definition: rover_api.hpp:293
int ROVER_DISPLAY_INIT_
Flag to hold if RoverDisplay is initialized.
Definition: rover_display.hpp:68
void print(const char *string)
Prints a string to OLED display starting from cursor location.
Definition: rover_display.cpp:187
Adafruit_SSD1306 my_display
Object to handle OLED operations.
Definition: rover_display.hpp:63
RoverDisplay()
(Default) Constructor for RoverDisplay class
Definition: rover_display.cpp:47
void fillScreen(uint16_t color)
Fills the entire screen.
Definition: rover_display.cpp:290
void clearDisplay(void)
Clears the display.
Definition: rover_display.cpp:96
void display(void)
Displays the buffer contents on the OLED display.
Definition: rover_display.cpp:80
Contains the member functions to control OLED display on the Rover. This class is a wrapper API for A...
Definition: rover_display.hpp:57
void setTextColor(uint16_t c)
Sets the text color to either white or black.
Definition: rover_display.cpp:157
void setCursor(int16_t x, int16_t y)
Sets the cursor to a position in order to start typing text.
Definition: rover_display.cpp:127
static const int BLACK_COLOR
Static definition to indicate BLACK color.
Definition: rover_display.hpp:75
void drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color)
Draws a line.
Definition: rover_display.cpp:275
void setRotation(uint8_t x)
Used to rotate the display. Can be 0,1,2, or 3.
Definition: rover_display.cpp:365