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.
Dependents: CSC1300_EduBaseV2_Lab0 mbed_blinky EduBaseV2_Lab0 mbed_blinky ... more
SSLED Class Reference
A 7-segment LED interface for driving 4 seven-segment LEDs connected via two cascaded 74HC595s using the STM32F031K6 SPI peripheral. More...
#include <TTU_CSC1300.h>
Public Member Functions | |
SSLED (int display, int pattern) | |
Constructor to create the 4-digit seven-segment display interface. | |
void | setDisplay (int display, int pattern) |
Write a pattern to a chosen display. |
Detailed Description
A 7-segment LED interface for driving 4 seven-segment LEDs connected via two cascaded 74HC595s using the STM32F031K6 SPI peripheral.
Specifically, the Nucleo32 F031K6 boards plugged into the Edubase-V2 via the adapter used at Tennessee Tech.
Supports only the four seven-segment displays (DISP1-DISP4) on the EduBase-V2 board
#include "mbed.h" #include "TTU_CSC1300.h" SSLED seg7(4, ~0x00); // blank DISP4 on Edubase-V2 board int main() { while(1) { seg7.setDisplay( 1, ~0x3F); // display "0" wait(1.0); seg7.setDisplay( 2, ~0x06); // display "1" wait(1.0); seg7.setDisplay( 3, ~0x5B); // display "2" wait(1.0); seg7.setDisplay( 4, ~0x4F); // display "3" wait(1.0); } // end while() } // end main()
Definition at line 380 of file TTU_CSC1300.h.
Constructor & Destructor Documentation
SSLED | ( | int | display, |
int | pattern | ||
) |
Constructor to create the 4-digit seven-segment display interface.
- Parameters:
-
display integer (1-4) selected desired 7-segment display DISP1-DISP4 pattern byte containing bitmask of to display (zeroed bits illuminate)
- See also:
- setDisplay()
Definition at line 142 of file TTU_CSC1300.cpp.
Member Function Documentation
void setDisplay | ( | int | display, |
int | pattern | ||
) |
Write a pattern to a chosen display.
- Parameters:
-
display integer (1-4) selected desired 7-segment display DISP1-DISP4 pattern byte containing bitmask of to display (zeroed bits illuminate)
- Note:
- MSb in pattern is decimal point segment, then gfedcba (with segment a as LSb). Zeroes in the pattern bitmask are illuminated. For example, pattern ~0x66 will illuminate the number "4".
Definition at line 153 of file TTU_CSC1300.cpp.
Generated on Sun Aug 7 2022 05:37:53 by
