Question: C programming Answer the 2 questions and modify the code to make led00 blink then modify it to make led02 blink. (Note this is using
C programming
Answer the 2 questions and modify the code to make led00 blink then modify it to make led02 blink. (Note this is using a ZCU104 evalution board)
#include
#include
#define ONE_SEC 33000000
int main() {
XGpio output;
int led_val = 0, count;
XGpio_Initialize(&output, XPAR_AXI_GPIO_1_DEVICE_ID); // initialize output XGpio variable
XGpio_SetDataDirection(&output, 1, 0x0); // LED outputs, 0 = output 1 = input
while (true) {
XGpio_DiscreteWrite(&output, 1, led_val); // Write value to GPIO
led_val ^= 1; // 1. What do these two lines do?
led_val &= 1;
for (count = 0; count < ONE_SEC; count++); // 2. What does this line do?
}
}
The questions are in the program
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
