GPIO Android Pull-Up and Pull-Down

3 659
Hello everyone!

Thanks in advance for any help you may provide.

I have been playing with the GPIO within Android using the sample code provided in the wiki. Things are going great for the output but for the input I was wondering if there was any way to activate the pull-up or pull-down resistors associated with the GPIO pins? I am having issues with my signal floating when no voltage is present and the easiest fix would be to enable the pull-down resistor for the GPIO pin.

Thanks for any information,
Edited by hnsncxy at Apr 20, 2016 21:06

You should know not all GPIO support the pull-down/up on the 40Pin Header according to the datasheet for the s500. and you can know about more information by visiting the LMK.GPIO library at
#pull-up/down pins for the LeMaker Guitar, and the P3, P5, P19 and P23 of the pull-up has been enabled by connecting the external pull-up resistor, don't need to operate by using the software.

#-----------P8 P10 P12 P13 P15 P16 P22-----------#
pullUpGt = (8, 10, 12, 13, 15, 16, 22)  #Pull-UP pins which be configured by the software
pullDwGt = (16,)                        #Pull-Down pins which be configured by the software

I think you choose the right pin which can meet your needs. eg: P16.

Edited by SDMatt619 at Apr 21, 2016 07:29

Thank you for the the reply. I will try using GPIO 16 and see if it solves my floating issue. I guess I am a little confused though since I was under the impression that LMK.GPIO library was for the linux side of the IO control; I didn't realize it was being used in the background on the Android side of things. But I looked at the help documentation on the wiki for the Android java GPIO and there is an import statement for LMK in the SPI side of things so I am hopeful that your suggestion works. I was not using SPI so I hadn't looked at that before. Thanks again for helping a novice out I really appreciate it.

See 283 in the datasheet,

You have to log in before you can reply Login | Sign Up

Points Rules