Simple Electronic Angle Meter and Spirit Level.
N5110 Class Reference
Library for interfacing with Nokia 5110 LCD display (https://www.sparkfun.com/products/10168) using the hardware SPI on the mbed. More...
#include <main.h>
Public Member Functions | |
| N5110 (PinName pwrPin, PinName scePin, PinName rstPin, PinName dcPin, PinName mosiPin, PinName sclkPin, PinName ledPin) | |
| Create a N5110 object connected to the specified pins. | |
| void | init () |
| Initialise display. | |
| void | turnOff () |
| Turn off. | |
| void | clear () |
| Clears. | |
| void | normalMode () |
| Turn on normal video mode (default) Black on white. | |
| void | inverseMode () |
| Turn on inverse video mode (default) White on black. | |
| void | setBrightness (float brightness) |
| Set Brightness. | |
| void | printString (const char *str, int x, int y) |
| Print String. | |
| void | setPixel (int x, int y) |
| Set a Pixel. | |
| void | clearPixel (int x, int y) |
| Clear a Pixel. | |
| void | refresh () |
| Refresh display. | |
| void | drawCircle (int x0, int y0, int radius, int fill) |
| Draw Circle. | |
| void | drawLine (int x0, int y0, int x1, int y1, int type) |
| Draw Line. | |
Detailed Description
Library for interfacing with Nokia 5110 LCD display (https://www.sparkfun.com/products/10168) using the hardware SPI on the mbed.
Acknowledgements to Chris Yan's Nokia_5110 Library.
Definition at line 49 of file main.h.
Constructor & Destructor Documentation
| N5110 | ( | PinName | pwrPin, |
| PinName | scePin, | ||
| PinName | rstPin, | ||
| PinName | dcPin, | ||
| PinName | mosiPin, | ||
| PinName | sclkPin, | ||
| PinName | ledPin | ||
| ) |
Create a N5110 object connected to the specified pins.
Functions used to display characters and shapes.
- Parameters:
-
pwr Pin connected to Vcc on the LCD display (pin 1) sce Pin connected to chip enable (pin 3) rst Pin connected to reset (pin 4) dc Pin connected to data/command select (pin 5) mosi Pin connected to data input (MOSI) (pin 6) sclk Pin connected to serial clock (SCLK) (pin 7) led Pin connected to LED backlight (must be PWM) (pin 8)
Acknowledgements to Dr.Craig A. Evans's code.
Member Function Documentation
| void clearPixel | ( | int | x, |
| int | y | ||
| ) |
| void drawCircle | ( | int | x0, |
| int | y0, | ||
| int | radius, | ||
| int | fill | ||
| ) |
Draw Circle.
This function draws a circle at the specified origin with specified radius to the display. Uses the midpoint circle algorithm.
- Parameters:
-
x0 - x-coordinate of centre y0 - y-coordinate of centre radius - radius of circle in pixels fill - 0 transparent (w/outline), 1 filled black, 2 filled white (wo/outline)
| void drawLine | ( | int | x0, |
| int | y0, | ||
| int | x1, | ||
| int | y1, | ||
| int | type | ||
| ) |
Draw Line.
This function draws a line between the specified points using linear interpolation.
- Parameters:
-
x0 - x-coordinate of first point y0 - y-coordinate of first point x1 - x-coordinate of last point y1 - y-coordinate of last point type - 0 white,1 black,2 dotted
| void init | ( | ) |
| void inverseMode | ( | ) |
| void normalMode | ( | ) |
| void printString | ( | const char * | str, |
| int | x, | ||
| int | y | ||
| ) |
| void refresh | ( | ) |
| void setBrightness | ( | float | brightness ) |
| void setPixel | ( | int | x, |
| int | y | ||
| ) |
Generated on Tue Jul 12 2022 14:28:55 by
1.7.2