Question
Write a C program to do the following: Your program should define three arrays such that Array1 has eight values: $01, $02, $03, $04, $05,
Write a C program to do the following:
Your program should define three arrays such that Array1 has eight values: $01, $02, $03, $04, $05, $06, $07, $08 and Array2 has eight values: $11, $12, $13, $14, $15, $16, $17, $18, and Array3 has eight bytes reserved. The program reads DIP switches, then, does the followings:
1. If the readings are exactly %00001001 = $09, then, it will turn on LED3 and LED0, and copy the data from Array1 to Array3; after copying data, your program is done.
2. If the readings are exactly %10010000 = $90, then, it will turn on LED7 and LED4, and copy the data from Array2 to Array3; after copying data, your program is done.
3. If the readings are neither $09 nor $90, then, turn on all LEDs, and go back to read DIP switches repeatedly until one of the two correct readings above is available.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started