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
Related questions
Question

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);](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F6e366a85-c23b-450a-9bc7-d2ea0be52d3f%2F0daa3a20-2a5b-4664-9d7c-03091b3cbcf1%2Fwfxygbi_processed.png&w=3840&q=75)
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

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps

Knowledge Booster
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.Recommended textbooks for you

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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education