keyestudio
www.keyestudio.com
{
for(int i = 0; i < 256; i++)
{
updateLEDs(i);
delay(500);
}
}
void updateLEDs(int value)
{
digitalWrite(latch, LOW);//
shiftOut(data, clock, MSBFIRST, ~value);// serial data “output”, high level first
digitalWrite(latch, HIGH);// latch
}
//////////////////////////////////////////////////////////
Test Result
After downloading the program, you can see 8 LEDs display 8-bit binary number.
*******************************************************************************
Project 17: 1-digit LED Segment Display
Introduction
LED segment displays are common for displaying numerical information. It's widely applied on
displays of electromagnetic oven, full automatic washing machine, water temperature display,
electronic clock, etc. It is necessary for us to learn how it works.
LED segment display is a semiconductor light-emitting device. Its basic unit is a light-emitting
diode (LED). LED segment display can be divided into 7-segment display and 8-segment