Erriez DHT22 library for Arduino  1.2.0
AM2302/AM2303 DHT22 temperature and humidity sensor library for Arduino
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TM1637 Class Reference

TM1637 class. More...

#include <ErriezTM1637.h>

Public Member Functions

 TM1637 (uint8_t clkPin, uint8_t dioPin, bool displayOn=true, uint8_t brightness=5)
 TM1637 constructor. More...
 
virtual void begin ()
 Initialize TM1637 controller.
 
virtual void end ()
 Release TM1637 pins.
 
virtual void displayOn ()
 Turn Display on.
 
virtual void displayOff ()
 Turn display off.
 
virtual void setBrightness (uint8_t brightness)
 Set brightness LED's. More...
 
virtual void clear ()
 Turn all LED's off.
 
virtual void writeData (uint8_t address, uint8_t data)
 Write display register. More...
 
virtual void writeData (uint8_t address, const uint8_t *buf, uint8_t len)
 Write buffer to multiple display registers. More...
 
virtual uint8_t getKeys ()
 Get key states. More...
 

Protected Member Functions

virtual void writeDisplayControl ()
 Write display control register.
 
virtual void writeCommand (uint8_t cmd)
 Write command to TM1637.
 
virtual void start ()
 Generate start condition.
 
virtual void stop ()
 Generate stop condition.
 
virtual void writeByte (uint8_t data)
 Write byte to TM1637. More...
 
virtual uint8_t readByte ()
 Read byte from TM1637. More...
 

Protected Attributes

uint8_t _clkPin
 Clock pin.
 
uint8_t _dioPin
 Data pin.
 
bool _displayOn
 Display on and off status for display control register.
 
uint8_t _brightness
 Display brightness for display control register.
 

Detailed Description

TM1637 class.

Definition at line 141 of file ErriezTM1637.h.

Constructor & Destructor Documentation

◆ TM1637()

TM1637::TM1637 ( uint8_t  clkPin,
uint8_t  dioPin,
bool  displayOn = true,
uint8_t  brightness = 5 
)

TM1637 constructor.

Constructor with pin arguments: C-D (Clock, Data)

Parameters
clkPinTM1637 CLK pin.
dioPinTM1637 DIO pin.
displayOntrue: Turn display on (default) false: Turn display off
brightnessDisplay brightness value 0..7

Definition at line 49 of file ErriezTM1637.cpp.

Member Function Documentation

◆ getKeys()

uint8_t TM1637::getKeys ( )
virtual

Get key states.

Returns
0xFF: All keys up 0x00..0x0F: Key 0..15 down

Definition at line 191 of file ErriezTM1637.cpp.

◆ readByte()

uint8_t TM1637::readByte ( )
protectedvirtual

Read byte from TM1637.

Returns
8-bit value.

Definition at line 316 of file ErriezTM1637.cpp.

◆ setBrightness()

void TM1637::setBrightness ( uint8_t  brightness)
virtual

Set brightness LED's.

Parameters
brightnessDisplay brightness value 0..7

Definition at line 124 of file ErriezTM1637.cpp.

◆ writeByte()

void TM1637::writeByte ( uint8_t  data)
protectedvirtual

Write byte to TM1637.

Parameters
data8-bit value.

Definition at line 276 of file ErriezTM1637.cpp.

◆ writeData() [1/2]

void TM1637::writeData ( uint8_t  address,
uint8_t  data 
)
virtual

Write display register.

Parameters
addressDisplay address 0x00..0x05
dataValue 0x00..0xFF

Definition at line 151 of file ErriezTM1637.cpp.

◆ writeData() [2/2]

void TM1637::writeData ( uint8_t  address,
const uint8_t *  buf,
uint8_t  len 
)
virtual

Write buffer to multiple display registers.

Write buffer to TM1638 with auto address increment

Parameters
addressDisplay address 0x00..0x05
bufBuffer
lenBuffer length

Definition at line 172 of file ErriezTM1637.cpp.


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