Question: Using C programming write a program to turn ona LEDusing araspberry pi by writing HIGH to that GPIO pin, display a message stating it is

Using C programming write a program to turn ona LEDusing araspberry pi by writing HIGH to that GPIO pin, display a message stating it is currently on, and wait for the user to press the Enter key, then turn off the LED by writing LOW to the chosen pin. Your output should look like this: The LED is currently ON - Press key to turn off - The LED is currently OFF In order to access the GPIO pins, your program must include the WiringPi library header: wiringPi.h. Also, your program must setup the pin modes by including the following statements (in the main function): wiringPiSetup(); pinMode(, );. Note that is the WiringPi pin number that corresponds to the Raspberry Pi GPIO Header pin number.If you want to set a pin as either an output or input pin, then must be set to either OUTPUT or INPUT. For example, to set pin 0 (header pin 11) as output, you would right: pinMode(0,OUTPUT);. When a pin mode is set to output, you can change its state by writing the following: digitalWrite(,) where is either HIGH or LOW. If set to HIGH, the pins voltage will be set at 3.3v. If set to LOW, its voltage should be close to 0v. Note that to use getchar() you should include the string.h library header.

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!