Easyuino  1.2.0
Easyuino::SevenSegments Class Reference

SevenSegments API is used to interact with seven segments displays. More...

#include <SevenSegments.h>

Inheritance diagram for Easyuino::SevenSegments:
Easyuino::Device

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...
 
- Public Member Functions inherited from Easyuino::Device
 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

- Protected Attributes inherited from Easyuino::Device
bool _isInitialized
 Used to know if the device API is initialized and ready to receive requests.
 

Detailed Description

SevenSegments API is used to interact with seven segments displays.

See also
Devices Supported: TM1637 Driver
Devices Tested: TM1637 Driver

Constructor & Destructor Documentation

◆ SevenSegments()

Easyuino::SevenSegments::SevenSegments ( IN uint8_t  clkPin,
IN uint8_t  dataPin 
)

Constructor.

Parameters
clkPinArduino pin connected to CLK pin
dataPinArduino pin connected to DATA pin

Member Function Documentation

◆ begin() [1/2]

bool Easyuino::SevenSegments::begin ( )
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.

Returns
True: If the device was initialized. False: Otherwise.

Implements Easyuino::Device.

◆ begin() [2/2]

bool Easyuino::SevenSegments::begin ( IN uint8_t  brightness)

Initializes the API and sets the brightness of the display.

Parameters
brightnessLevel of display brightness. Accepted values are [0,7]

◆ end()

void Easyuino::SevenSegments::end ( )
virtual

Used to stop the device API.

After this the the device will not process API requests.

Implements Easyuino::Device.

◆ print() [1/4]

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].

Parameters
digitDigit to be displayed
positionPosition to where display the digit

◆ print() [2/4]

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.

Parameters
numberNumber to be displayed

◆ print() [3/4]

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.

Parameters
numberNumber to be displayed

◆ print() [4/4]

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!

Parameters
stringThe string to be displayed

◆ setBrightness()

void Easyuino::SevenSegments::setBrightness ( IN uint8_t  brightness)

sets the brightness of the display

Parameters
brightnessLevel of display brightness. Accepted values are [0,7]

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