This example shows how to control a user LED (LED3):

http://users.freebasic-portal.de/tjf/Projekte/libpruio/doc/html/sos_8c_source.html

This example shows how to read the state of a button:

http://users.freebasic-portal.de/tjf/Projekte/libpruio/doc/html/button2_8c_source.html

The only onboard button connected to a GPIO is the boot button, wired to 
P8_43. So you have to adapt #define PIN P8_43. And since the button 
switches GND, you should use a pull-up resistor: if (pruio_gpio_config 
<http://users.freebasic-portal.de/tjf/Projekte/libpruio/doc/html/pruio__c__wrapper_8bas.html#ac5405314ef2c35a9604262a22378420d>(io,
 
PIN 
<http://users.freebasic-portal.de/tjf/Projekte/libpruio/doc/html/button2_8c.html#ae1a27401b7fb01ccb9a82dbddbb54eea>,
 
PRUIO_GPIO_IN_1 
<http://users.freebasic-portal.de/tjf/Projekte/libpruio/doc/html/pruio__globals_8bi.html#a4d604dbec305f941aaa452cc0d01adeea661a5356f0da98015d241d42084a0f30>))
 
{...

Merge both examples together and off you go.

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/1c9f62f4-28a6-4987-886a-7a12c6eb86b9%40googlegroups.com.

Reply via email to