The library is implemented by a high -performance driver of the seven -hese indicator.
The class implements two designers, allowing you to indicate segments or array or link to the port as pins. The second option works much faster, but not always possible. By default, a designer with an array of segments is used. What to re-properly use the SEVENSEGMENT_USE_PORT constant, announced before connecting the class. The order of segments and the order of Pino ports coincide, i.e. PIN PX0 = segment A, pin px1 = segment b, ..., pin px7 = segment DP.
The logic of the output signals by default is straight, i.e. To turn it on, it is fed '1', to turn off '0'. This behavior can be changed using constants announced before connecting the class.
SEVENSEGMENT_INVERT_DIGITS - inversion of the signal of the indicator discharges.SEVENSEGMENT_INVERT_SEGMENTS - Inversion of the signal of the indicator segments. In order to optimize and save resources, the number of segments is indicated through SEVENSEGMENT_DIGITS constant.
For example:
#define SEVENSEGMENT_INVERT_SEGMENTS
#define SEVENSEGMENT_INVERT_DIGITS
#define SEVENSEGMENT_USE_PORT
#define SEVENSEGMENT_DIGITS 4
#include <SevenSegment.h>
...| Method | Description | Parameters |
|---|---|---|
SevenSegmentCore(const uint8_t *pinDigits, volatile uint8_t *port) | Class designer | pinDigits - array of pains of dischargesport - link to segments port |
SevenSegmentCore(const uint8_t *pinDigits, const uint8_t *pinSegments) | Class designer | pinDigits - array of pains of dischargespinSegments - array of segments pins |
void Begin() | Initialize class and timer | - |
void SetBrightness(uint8_t brightness) | Install brightness with an indicator | brightness - brightness |
void SetNums(int32_t number) | Setting the number (not implemented) | number - number |
void SetNums(float number) | Setting the number (not implemented) | number - number |
void SetPower(bool status) | Indicator power management | status - turn on or off the indicator |
void SetChr(uint8_t position, char character) | Set the symbol in the indicated position | position - positioncharacter is a symbol |
void SetNum(uint8_t position, uint8_t number) | Set the figure in the indicated position | position - positionnumber - digit |
void SetDot(uint8_t position, bool dot) | Set Remove the point in the indicated position | position - positiondot is a point |
void SetRAW(uint8_t position, byte data) | Install the RAW byte in the indicated position | position - positiondata - byte |
void Clear() | Clean the indicator | - |
void Lighting() | The next category method | - |
| `VOID Dimming () | The method of extinguishing the current category | - |