androidthings / sample-simplepio

Basic Peripheral I/O examples with Android Things
Apache License 2.0
190 stars 79 forks source link

Pin set to output never returns high for getValue. #4

Closed Apromixately closed 7 years ago

Apromixately commented 7 years ago

I have this board http://www.wandboard.org/details/pico-imx6ul and tried the led blinking code but getValue on the gpio pin always returns false. This is true even with nothing connected to the pin so it cannot accidentally be pulled down.

mangini commented 7 years ago

getValue() on an output pin returns an unpredictable value, as stated in the [API javadoc](https://developer.android.com/things/reference/com/google/android/things/pio/Gpio.html#getValue())

An early version of this sample relied on getValue(), but it was fixed on this commit: https://github.com/androidthings/sample-simplepio/commit/9c1147d4c34a155b10b6f35fa227bda992551c8a