- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have got the BCM920737TAG board. Am looking to very simply turn on the LED that's connected to P14/P38. Anyone got any quick tips how to initialise the pin then turn the LED on or off?
Really simple code I'm looking for, nothing to do with BTLE stack really.
Cheers!
Solved! Go to Solution.
- Labels:
-
GPIO
- Tags:
- bcm920732tag_q32
- gpio
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I believe the following is correct:
// The following will drive P14 low, and if the LED is hooked up right, it will turn on
gpio_configurePin(14/16, 14%16, GPIO_OUTPUT_ENABLE, 0);
I believe that the /16 and Modulus operator are being used to map the Port and the physical pin.
Ex.
P0 – P15 = PORT0
P16-P31 = PORT1
P32-P38 = PORT2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We admittedly do not do a very good job of documenting how to enable these types of simple functions.
However, I think this one has been discussed in detail here and vsesto provided some sample code that you will find helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks for the response
so to conclude: if you want to turn an LED on (where the LED is grounded via the attached GPIO) you call the following:
gpio_configurePin(n/16, n%16, GPIO_OUTPUT_ENABLE, 0);
Where "n" is the number in "Pn" e.g. n=14 when P14?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I believe the following is correct:
// The following will drive P14 low, and if the LED is hooked up right, it will turn on
gpio_configurePin(14/16, 14%16, GPIO_OUTPUT_ENABLE, 0);
I believe that the /16 and Modulus operator are being used to map the Port and the physical pin.
Ex.
P0 – P15 = PORT0
P16-P31 = PORT1
P32-P38 = PORT2