Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of OSL10564_74HC595 by
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) sdo must be SPI MOSI and sclk must be same SPI SCLK latch is any output port bright must 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:
-
britness max(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:
-
clock frequency (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:
-
ASCII data
- 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:
-
unsigned data (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:
-
Raw data (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:
-
all ASCII 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.
Generated on Fri Jul 15 2022 08:51:20 by
1.7.2
