Question: IN C FOR DE0 BOARD /******************************************************************************** * This program demonstrates the use of parallel ports in the DE0 Media Computer: * 1. displays the SW
IN C FOR DE0 BOARD /******************************************************************************** * This program demonstrates the use of parallel ports in the DE0 Media Computer: * 1. displays the SW switch values on the green LEDG * 2. displays a rotating pattern on the HEX displays * 3. if KEY[2..1] is pressed, uses the SW switches as the pattern ********************************************************************************/ int main(void) { /* Declare volatile pointers to I/O registers (volatile means that IO load and store instructions (e.g., ldwio, stwio) will be used to access these pointer locations) */ volatile int * green_LED_ptr = (int *) 0x10000010; // green LED address volatile int * HEX3_HEX0_ptr = (int *) 0x10000020; // HEX3_HEX0 address volatile int * SW_switch_ptr = (int *) 0x10000040; // SW slider switch address volatile int * KEY_ptr = (int *) 0x10000050; // pushbutton KEY address int HEX_bits = 0x0000000F; // pattern for HEX displays int SW_value, KEY_value, delay_count; while(1) { SW_value = *(SW_switch_ptr); // read the SW slider switch values *(green_LED_ptr) = SW_value; // light up the LEDs KEY_value = *(KEY_ptr); // read the pushbutton KEY values if (KEY_value != 0) // check if any KEY was pressed { HEX_bits = SW_value; // set pattern using SW values while (*KEY_ptr); // wait for pushbutton KEY release } *(HEX3_HEX0_ptr) = HEX_bits; // display pattern on HEX3 ... HEX0 if (HEX_bits & 0x80000000) /* rotate the pattern shown on the HEX displays */ HEX_bits = (HEX_bits 
1)Write a program that reads the 10 slider switches, and: a. Displays their value on the 10 Green LEDs b. Convert the values read from the 10 slider switches to hexadecimal and display the result on the appropriate number of 7-segment displays. The decimal point should remain off. 2) Use the Example program as a template (no rotation required in this exercise) 3) Loop the program continually so new choices can be entered. 1)Write a program that reads the 10 slider switches, and: a. Displays their value on the 10 Green LEDs b. Convert the values read from the 10 slider switches to hexadecimal and display the result on the appropriate number of 7-segment displays. The decimal point should remain off. 2) Use the Example program as a template (no rotation required in this exercise) 3) Loop the program continually so new choices can be entered Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
