Noiasca LED Control
An improved library to control MAX7219/MAX7221 Seven Segment LED displays
Public Member Functions | List of all members
LedControl_base Class Reference

Base class for MAX7219/MAX7221. More...

#include <NoiascaLedControlCommon.h>

Inheritance diagram for LedControl_base:
LedControl LedControlSpi

Public Member Functions

uint8_t getDeviceCount ()
 get the number of devices attached of this object. More...
 
void shutdown (uint8_t addr, bool status)
 Set the shutdown (power saving) mode for the device. More...
 
void setScanLimit (uint8_t addr, uint8_t limit)
 Set the number of digits (or rows) to be displayed. More...
 
void setIntensity (uint8_t addr, uint8_t intensity)
 Set the brightness of the display. More...
 
void clearDisplay (uint8_t addr)
 Switch all LEDss on the display off. More...
 
void setLed (uint8_t addr, uint8_t row, uint8_t col, boolean state)
 Set the status of a single LEDs. More...
 
void setRow (uint8_t addr, uint8_t row, uint8_t value)
 Set all 8 LEDs in a row to a new state. More...
 
void setColumn (uint8_t addr, uint8_t col, uint8_t value)
 Set all 8 LEDs in a column to a new state. More...
 
void setDigit (uint8_t addr, uint8_t digit, uint8_t value, boolean dp)
 Display a hexadecimal digit on a 7-Segment Display. More...
 
void setChar (uint8_t addr, uint8_t digit, char value, boolean dp)
 Display a character on a 7-Segment display. More...
 
void setEndOfDevice (optionEndOfDevice newOption)
 Change the option of what should happen at the End of the Line (End of one Device/Adress) More...
 
void setCursor (uint8_t newPosition)
 Set the cursor to a specific position. More...
 
void setCursor (uint8_t addr, uint8_t devPosition)
 Set the Cursor to a specific position. More...
 

Detailed Description

Base class for MAX7219/MAX7221.

This is an (abstract) class used as base for software bitbang and HW-SPI. It holds all common variables and member functions. If you create your instance (your object), don't use this base class but one of the two implementations

See also
LedControl
LedControlSpi

Member Function Documentation

◆ getDeviceCount()

uint8_t LedControl_base::getDeviceCount ( )

get the number of devices attached of this object.

Returns
the number of devices (MAX7219/MAX7221) of this object

◆ shutdown()

void LedControl_base::shutdown ( uint8_t  addr,
bool  status 
)

Set the shutdown (power saving) mode for the device.

Parameters
addrThe address of the display to control
statusIf true the device goes into power-down mode. Set to false for normal operation.

◆ setScanLimit()

void LedControl_base::setScanLimit ( uint8_t  addr,
uint8_t  limit 
)

Set the number of digits (or rows) to be displayed.

See datasheet for sideeffects of the scanlimit on the brightness of the display.

Parameters
addraddress of the display to control
limitnumber of digits to be displayed (1..8)

◆ setIntensity()

void LedControl_base::setIntensity ( uint8_t  addr,
uint8_t  intensity 
)

Set the brightness of the display.

Parameters
addrthe address of the display to control
intensitythe brightness of the display. (0..15)

◆ clearDisplay()

void LedControl_base::clearDisplay ( uint8_t  addr)

Switch all LEDss on the display off.

Parameters
addraddress of the display to control

◆ setLed()

void LedControl_base::setLed ( uint8_t  addr,
uint8_t  row,
uint8_t  col,
boolean  state 
)

Set the status of a single LEDs.

Parameters
addraddress of the display
rowthe row of the LEDs (0..7)
colthe column of the LEDs (0..7)
stateIf true the led is switched on, if false it is switched off

◆ setRow()

void LedControl_base::setRow ( uint8_t  addr,
uint8_t  row,
uint8_t  value 
)

Set all 8 LEDs in a row to a new state.

Parameters
addraddress of the display
rowrow which is to be set (0..7)
valueeach bit set to 1 will light up the corresponding LED.

◆ setColumn()

void LedControl_base::setColumn ( uint8_t  addr,
uint8_t  col,
uint8_t  value 
)

Set all 8 LEDs in a column to a new state.

Parameters
addraddress of the display
colcolumn which is to be set (0..7)
valueeach bit set to 1 will light up the corresponding LED

◆ setDigit()

void LedControl_base::setDigit ( uint8_t  addr,
uint8_t  digit,
uint8_t  value,
boolean  dp 
)

Display a hexadecimal digit on a 7-Segment Display.

Note
use lc.print(value, HEX) instead.
Parameters
addraddress of the display
digitthe position of the digit on the display (0..7)
valuethe value to be displayed. (0x00..0x0F)
dpsets the decimal point.

◆ setChar()

void LedControl_base::setChar ( uint8_t  addr,
uint8_t  digit,
char  value,
boolean  dp 
)

Display a character on a 7-Segment display.

There are only a few characters that make sense here : '0','1','2','3','4','5','6','7','8','9','0', 'A','b','c','d','E','F','H','L','P', '.','-','_',' '

Note
use print instead.
Parameters
addraddress of the display
digitthe position of the character on the display (0..7)
valuethe character to be displayed.
dpsets the decimal point.

◆ setEndOfDevice()

void LedControl_base::setEndOfDevice ( optionEndOfDevice  newOption)

Change the option of what should happen at the End of the Line (End of one Device/Adress)

Parameters
newOptionone of following values
See also
optionEndOfDevice

◆ setCursor() [1/2]

void LedControl_base::setCursor ( uint8_t  newPosition)

Set the cursor to a specific position.

Parameters
newPositionnew absolute position

◆ setCursor() [2/2]

void LedControl_base::setCursor ( uint8_t  addr,
uint8_t  devPosition 
)

Set the Cursor to a specific position.

Parameters
addradress of device
devPositionposition in device. The order is 01234567 !