Experiment 2 - 8-Ways Dip Switches To 8 Output Leds - ablelogic AVR-DK20A User Manual

Avr development board
Table of Contents

Advertisement

6.2 Experiment 2 – 8-Ways DIP Switches to 8 Output LEDs
Jumper Setting: LK9-LK16 (B0-L0, B1-L1, B2-L2, B3-L3, B4-L4, B5-L5, B6-L6, B7-L7)
: LK17-LK24 (C0-DP0, C1-DP1, C2-DP2, C3-DP3, C4-DP4, C5-DP5, C6-DP6,
C7- DP7)
Port Setting: Set Port B as output, Port C as input
Objective:
Create a project, reading input from the 8 input DIP switch and output result to 8 LEDs
display.
Flow Chart:
Port Setting information:
DDRB = 0xFF;
DDRC = 0x00;
Expected Result
You will see what ever input you set from the DIP switch will display on the LEDs Display.
Tutorial 2 – Create a project, sensing 01h from DIP switch, if 01h sensed, light ON all 8-bit
LEDs else 8-bit LEDs set to OFF.
AVR Development Board – AVR-DK20A User Manual
Start
Initialize I/O
Infinity Loop
Reading input
from DIP Switch
Output result to
LEDs Display
// Set direction to be output (PortB)
//Set direction to be input (PortC)
25

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the AVR-DK20A and is the answer not in the manual?

Questions and answers

Table of Contents