Shivanand Gowda / 74HC595

Dependents:   Multiple_7SegDisplays

Fork of OSL10564_74HC595 by Kenji Arai

Embed: (wiki syntax)

« Back to documentation index

SevenSegLed Class Reference

SevenSegLed Class Reference

#include <7segLed_HC595.h>

Public Member Functions

 SevenSegLed (PinName sdo, PinName sclk, PinName latch, PinName bright, uint8_t num_of_digit)
 7segments LED driver with 74HC595 (SER, SRCLK, RCLK, /OE)
void put_num (int32_t dt)
 Set data into 7seg LED's.
void put_ascii (const char *data)
 Set ascii number into 7seg LED's.
void put_strings (const char *data)
 Set ascii character strings into 7seg LED's.
void put_raw (uint8_t *data)
 Set raw data into 7seg LED's.
void put_dot (uint16_t position)
 Set dot into 7seg LED's.
void brightness (float bright)
 Set Brightness.
void zero_suppress (bool mode)
 Set Zero Suppress (defalt OFF)
void frequency (int32_t freq)
 Set clock frequency.

Detailed Description

 #include "mbed.h"
 #include "7segLed_HC595.h"

 // case for Nucleo-F446RE, F411RE, F401RE
 //              SPI MOSI, SCLK,port/out,PWM, num of digits
 SevenSegLed  led_7segs(D4, D3,  D5,      D2,  6);

  int main() {
      int32_t count = 123456U;
      while(true) {
          led_7segs = count++;
          wait(0.1f);
      }
  }

Definition at line 40 of file 7segLed_HC595.h.


Constructor & Destructor Documentation

SevenSegLed ( PinName  sdo,
PinName  sclk,
PinName  latch,
PinName  bright,
uint8_t  num_of_digit 
)

7segments LED driver with 74HC595 (SER, SRCLK, RCLK, /OE)

Parameters:
sdo(->SER), sclk (->SRCLK), latch (->RCLK), bright (->/OE)
sdomust be SPI MOSI and sclk must be same SPI SCLK
latchis any output port
brightmust be PwmOut port
num_of_digit-> # of 7seg LED's

Definition at line 6 of file 7segLed_HC595.cpp.


Member Function Documentation

void brightness ( float  bright )

Set Brightness.

Parameters:
britnessmax(1.0f) and min = all LED off(0.0f)
Returns:
none

Definition at line 96 of file 7segLed_HC595.cpp.

void frequency ( int32_t  freq )

Set clock frequency.

Parameters:
clockfrequency (default 1000000Hz(1MHz))
Returns:
none

Definition at line 102 of file 7segLed_HC595.cpp.

void put_ascii ( const char *  data )

Set ascii number into 7seg LED's.

Parameters:
ASCIIdata
Returns:
none

Definition at line 33 of file 7segLed_HC595.cpp.

void put_dot ( uint16_t  position )

Set dot into 7seg LED's.

Parameters:
position(1= LSB, 2=2nd, 4=3rd, 8=4th, 16, 32, 64 ----)
Returns:
none

Definition at line 81 of file 7segLed_HC595.cpp.

void put_num ( int32_t  dt )

Set data into 7seg LED's.

Parameters:
unsigneddata (overflow may occur depend on number of LEDs)
Returns:
none

Definition at line 22 of file 7segLed_HC595.cpp.

void put_raw ( uint8_t *  data )

Set raw data into 7seg LED's.

Parameters:
Rawdata (Segment element)
Returns:
none

Definition at line 69 of file 7segLed_HC595.cpp.

void put_strings ( const char *  data )

Set ascii character strings into 7seg LED's.

Parameters:
allASCII character
Returns:
none

Definition at line 208 of file 7segLed_HC595.cpp.

void zero_suppress ( bool  mode )

Set Zero Suppress (defalt OFF)

Parameters:
mode=true-> zero suppress ON, mode = false -> OFF
Returns:
none

Definition at line 91 of file 7segLed_HC595.cpp.