Easyuino
1.2.0
|
SevenSegments API is used to interact with seven segments displays. More...
#include <SevenSegments.h>
Public Member Functions | |
SevenSegments (IN uint8_t clkPin, IN uint8_t dataPin) | |
Constructor. More... | |
~SevenSegments () | |
Destructor. | |
bool | begin () |
Used to put the device ready to receive requests. More... | |
bool | begin (IN uint8_t brightness) |
Initializes the API and sets the brightness of the display. More... | |
void | end () |
Used to stop the device API. More... | |
void | setBrightness (IN uint8_t brightness) |
sets the brightness of the display More... | |
void | print (IN uint8_t digit, IN uint8_t position) |
Print the digit (0-9) to the seven segment display of the position given. More... | |
void | print (IN unsigned int number) |
Print the unsigned number given using all the display. More... | |
void | print (IN int number) |
Print the signed number given using all the display. More... | |
void | print (IN const char *string) |
Print the string in to the display. More... | |
![]() | |
Device () | |
Constructor called by every sub-classes. | |
~Device () | |
Destroy all the resources associated with the device. | |
bool | isInitialized () const |
Verify is the device is initialized and ready to use. More... | |
Additional Inherited Members | |
![]() | |
bool | _isInitialized |
Used to know if the device API is initialized and ready to receive requests. | |
SevenSegments API is used to interact with seven segments displays.
Easyuino::SevenSegments::SevenSegments | ( | IN uint8_t | clkPin, |
IN uint8_t | dataPin | ||
) |
Constructor.
clkPin | Arduino pin connected to CLK pin |
dataPin | Arduino pin connected to DATA pin |
|
virtual |
Used to put the device ready to receive requests.
Normally this have some default behaviour some devices have other overload method with same name that receives other arguments to device customization.
Implements Easyuino::Device.
bool Easyuino::SevenSegments::begin | ( | IN uint8_t | brightness | ) |
Initializes the API and sets the brightness of the display.
brightness | Level of display brightness. Accepted values are [0,7] |
|
virtual |
Used to stop the device API.
After this the the device will not process API requests.
Implements Easyuino::Device.
void Easyuino::SevenSegments::print | ( | IN uint8_t | digit, |
IN uint8_t | position | ||
) |
Print the digit (0-9) to the seven segment display of the position given.
Position indexes start in the left [0,3].
digit | Digit to be displayed |
position | Position to where display the digit |
void Easyuino::SevenSegments::print | ( | IN unsigned int | number | ) |
Print the unsigned number given using all the display.
If the number has more digits than display can represent the number is truncated and only the less significative digits are represented.
number | Number to be displayed |
void Easyuino::SevenSegments::print | ( | IN int | number | ) |
Print the signed number given using all the display.
If the number has more digits than display can represent the number is truncated and only the less significative digits are represented.
number | Number to be displayed |
void Easyuino::SevenSegments::print | ( | IN const char * | string | ) |
Print the string in to the display.
If the string has more chars than the display can represent the string is truncated and only the first chars are represented. Attention: Characters thar are not letters or numbers are skipped!
string | The string to be displayed |
void Easyuino::SevenSegments::setBrightness | ( | IN uint8_t | brightness | ) |
sets the brightness of the display
brightness | Level of display brightness. Accepted values are [0,7] |