Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

What are the purposes of collection messages? (Objective 5)

Answered: 1 week ago