[solved]-Task 1 Instructions 1 Write Program Read Data Set Four Switches Output Data Set 4 Discrete Q39075829
help new to coding in C! we are using the Freedom boardKL46Z
Task #1 Instructions 1. You are to write a program that will read data from a set of four switches and output data to both a set of 4 discrete LEDs and a 7-segment LED. 2. You will need to select four pins to which you will connect four switches wired appropriately. You will need to select four pins to which you will connect four discrete LEDs wired appropriately. You will need to select seven pins to which you will connect the 7 LEDs of the 7-segment display. You will not need the decimal point for this program. You will need to wire these appropriately. 3. Your program should do the following: • Initialize the individual pins and/or ports for controlling the switches and LEDs. Define any variables needed by the program. In a main program loop … Read the 4 switches as a 4-bit number in the range 0-15. Echo this 4-bit number on the discrete LEDs. Using the 4-bit number, determine the appropriate 7-segment display pattern. The appropriate patterns are shown below. Output the 7-segment display patter to the 7-segment display. If the current 4-bit number is different than the last time through the loop, output the integer as a hexadecimal digit to the virtual serial port to the PC! Repeat the loop. Show transcribed image text Task #1 Instructions 1. You are to write a program that will read data from a set of four switches and output data to both a set of 4 discrete LEDs and a 7-segment LED. 2. You will need to select four pins to which you will connect four switches wired appropriately. You will need to select four pins to which you will connect four discrete LEDs wired appropriately. You will need to select seven pins to which you will connect the 7 LEDs of the 7-segment display. You will not need the decimal point for this program. You will need to wire these appropriately. 3. Your program should do the following: • Initialize the individual pins and/or ports for controlling the switches and LEDs. Define any variables needed by the program. In a main program loop … Read the 4 switches as a 4-bit number in the range 0-15. Echo this 4-bit number on the discrete LEDs. Using the 4-bit number, determine the appropriate 7-segment display pattern. The appropriate patterns are shown below. Output the 7-segment display patter to the 7-segment display. If the current 4-bit number is different than the last time through the loop, output the integer as a hexadecimal digit to the virtual serial port to the PC! Repeat the loop.
Expert Answer
Answer to Task #1 Instructions 1. You are to write a program that will read data from a set of four switches and output data to bo… . . .
OR

