|
|
I’m having difficulties understanding how to use these pins. I can set them to make them inputs and outputs. I can also set each output pin to a 1 or 0. What I’m struggling with is how to read in from the input pins. Thank you for your help. :D |
|
|
Greetings mgurr, The way to get the GPIO information from the VH device is to use the IVonHippelModuleControl interface, and getStatus() method. This returns an integer with the status of the GPIO pins encoded. http://svn.buglabs.net/svn/!source/8228/bug/tags/release_candidates/RC1.4.7/com.buglabs.bug.module.vonhippel/com/buglabs/bug/module/vonhippel/pub/IVonHippelModuleControl.java#79 The encoding format can be found here: http://svn.buglabs.net/svn/!source/8228/bug/tags/release_candidates/RC1.4.7/bug-linux-2.6.27.2/drivers/bmi/pims/vonhippel/bmi_vh.c#501 I'll get back to you about specifically which bits in the integer are the GPIO pin status bits. It's bears mentioning that the bitwise operations will be abstracted out in a more Object Oriented manner with the next Von Hippel API enhancement. Hope this helps. -John |
|
|
mgurr, I’ve posted an app on BUGnet that should clarify the use of the GPIO pins on the VonHippel module. http://buglabs.net/applications/VHGPIOExample It just spawns two threads: one to read the GPIO state, the other to intermittently toggle GPIO pin 0 to high/low. You can wire pin 0 to any other pin to verify. |
|
|
Thank you very much. :D |