Question: For a lab, I'm having trouble writing a c program. We are using gpio 30 and 60 on a beaglebone black to turn on an
For a lab, I'm having trouble writing a c program. We are using gpio 30 and 60 on a beaglebone black to turn on an LED using a switch. The instructions are as follows:
Your program will duplicate these steps using a single c program with the makefile as a helper.
a) Add a makefile rule, named setup, similar to the clean rule that will implement the config-pin steps 1-4. Running the command make setup will run the config-pin setup functions.

b) You will need to account for switch bounce with programming. Debouncing can be accomplished in software by reading the value for the switch, delaying for a short period to account for the bouncing, then re-reading the switch. If the values are the same, the switch can be assumed to be inactive, if different than the switch can assumed to be active. The maximum time that a switch bounces typically is less than 50ms so that calling the function usleep (man -s3 usleep) with an argument of 50000 could be used in this test.
recommended config-pin usage config-pin P9_12 gpio config-pin P9_11 gpio config-pin P9_12 out config-pin P9_11 in 10
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
