Which LED lights are turned on? QA OB Qс QD QE QF QG QH

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Complete the Lesson with Eight LEDs with 74HC595.
This code uses a shift register to use a single data pin to light up 8 LEDs.
Run the code with the loop() replaced with
void loop ()
{
}
leds = 0b00001111;
Serial.println(leds);
00
digitalWrite (latchPin, LOW);
shiftOut (dataPin, clock Pin, MSBFIRST, leds);
digitalWrite (latchPin, HIGH);
delay (1000);
Which LED lights are turned on?
QA
QB
QC
QD
QE
QF
QG
QH
Transcribed Image Text:Complete the Lesson with Eight LEDs with 74HC595. This code uses a shift register to use a single data pin to light up 8 LEDs. Run the code with the loop() replaced with void loop () { } leds = 0b00001111; Serial.println(leds); 00 digitalWrite (latchPin, LOW); shiftOut (dataPin, clock Pin, MSBFIRST, leds); digitalWrite (latchPin, HIGH); delay (1000); Which LED lights are turned on? QA QB QC QD QE QF QG QH
// define the LED digit patterns, from 0-13
// 1 = LED on, 0= LED off, in this order:
//74HC595 pin
20, 01, 02, 03, 04, 05, 06, 07
byte seven_seg_digits [14] = {
B01111010, // = D
B10011100,
// = C
B00111110, //= B
B11101110,
//= A
B11100110, //=9
B11111110, //=8
B11100000, // = 7
B10111110, //= 6
//=5
B10110110,
B01100110,
//= 4
B11110010, //= 3
B11011010,
// = 2
B01100000,
// = 1
B11111100, //=0
// connect to the ST CP of 74HC595 (pin 9, latch pin)
int latchPin = 9;
// connect to the SH_CP of 74HC595 (pin 10, clock pin)
int clockPin = 10;
}
};
// connect to the DS of 74HC595 (pin 8)
int dataPin = 8;
void setup () {
// Set latchPin, clockPin, dataPin as output
pinMode(latchPin, OUTPUT);
}
pinMode (clockPin, OUTPUT);
pinMode (dataPin, OUTPUT);
// display a number on the digital segment display
void sevenSegWrite (byte digit) {
// set the latchPin to low potential, before sending data
digitalWrite (latchPin, LOW);
// the original data (bit pattern)|
shiftOut (dataPin, clockPin, LSBFIRST, seven_seg_digits [digit]);
// set the latchPin to high potential, after sending data
digitalWrite (latchPin, HIGH);
Transcribed Image Text:// define the LED digit patterns, from 0-13 // 1 = LED on, 0= LED off, in this order: //74HC595 pin 20, 01, 02, 03, 04, 05, 06, 07 byte seven_seg_digits [14] = { B01111010, // = D B10011100, // = C B00111110, //= B B11101110, //= A B11100110, //=9 B11111110, //=8 B11100000, // = 7 B10111110, //= 6 //=5 B10110110, B01100110, //= 4 B11110010, //= 3 B11011010, // = 2 B01100000, // = 1 B11111100, //=0 // connect to the ST CP of 74HC595 (pin 9, latch pin) int latchPin = 9; // connect to the SH_CP of 74HC595 (pin 10, clock pin) int clockPin = 10; } }; // connect to the DS of 74HC595 (pin 8) int dataPin = 8; void setup () { // Set latchPin, clockPin, dataPin as output pinMode(latchPin, OUTPUT); } pinMode (clockPin, OUTPUT); pinMode (dataPin, OUTPUT); // display a number on the digital segment display void sevenSegWrite (byte digit) { // set the latchPin to low potential, before sending data digitalWrite (latchPin, LOW); // the original data (bit pattern)| shiftOut (dataPin, clockPin, LSBFIRST, seven_seg_digits [digit]); // set the latchPin to high potential, after sending data digitalWrite (latchPin, HIGH);
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Printers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education