Question: Write a program, led _ pushbutton.c , compiled with GCC on the RPi , that performs the following steps: a . Includes file b .

Write a program, led_pushbutton.c, compiled with GCC on the RPi , that performs the following steps:
a. Includes file
b. Calls the function gpioInitialize()
c. Initializes the LED GPIO pin to be an output by calling gpioSetMode()
d. Initializes the Switch Input GPIO pin to be an input by calling gpioSetMode()
e. Sets the pull up resistor inside the RPI for the Switch GPIO pin by calling gpioSetPullUpDown(PIN,PI_PUD_UP)
f. Turns on the LED using gpioWrite()
g. Enters a while loop that calls gpioRead() and waits for the switch to read 1
h. Turns off the LED uIsing gpioWrite()
i. Calls gpioTerminate()

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 Databases Questions!