Question: Assignment Write a program using the GPIO method that performs the same tasks as the interrupt code snippet gmen in Listing 1 . Observe that

Assignment
Write a program using the GPIO method that performs the same tasks as the interrupt code snippet gmen in Listing 1. Observe that listing 1 simply defines that the CPU waits in an infinite loop formed by the code line while(true) When the user presses the button, this loop is interrupted. The CPU executes the function getButtons_callback. Afterward, ir turns back and waits in the infinite loop for another interrupt. You should use Mbed Studio.
Listing 1: Interrupt Code
Hundef ARM_FP
Hinclude "mbed h2
Digitalout greenLED(LED1).
interruptin userButton(BuTtoN1):
vaid getbuttons()
1
green ED= igreenteD;
1
int main|)
is
green LD=0,
userButton fall(8 getRuttons);
1/_enabie_rall:
while (true):
1
 Assignment Write a program using the GPIO method that performs the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!