A Pin no "Input floating" mode? #7365
Replies: 1 comment
-
Posted at 2020-04-02 by @gfwilliams The pins should stay floating by default on boot. It would only be if you did Posted at 2020-04-02 by user109783 What if the Pin stay floating by default on boot, use digitalRead(PIN), what result should I get? Posted at 2020-04-02 by @fanoush It will switch to input mode, try with pin.getMode() to see after calling digitalRead. Also there is now no explicit mode name to set it to be disconnected/floating again (e.g. like pin.mode("disconnected")). on nrf52 devices analogRead does that. In fact floating pins on nrf52 are reported as "analog" (even for pins 4-27 that cannot be used for analog reading) and pin.mode("analog") seems to set it floating/disconnected - at least on nrf52 platform. Posted at 2020-04-02 by @fanoush oh, and to topic title name - input mode is not floating, input mode (at least on nrf52) is sensing the input and draws some power, to save battery it should be in disconnected mode if not used, then it is really floating. On powerup it is in such mode if not used. Posted at 2020-04-03 by user109783 I read a statement about stm32F4, it said that this kind of chip can be individually configured by software in several modes, include input floating. However, the Espruion system did not have input floating, and initially I coded Pin.getInfo(), it shown that its' mode was analog. Posted at 2020-04-03 by @fanoush
yes so that's fine, as I tried to explain in post #4, this is what espruino shows when pin is floating (i.e. is not set to input nor output) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2020-04-02 by user109783
If I want a Pin stay in Input floating mode upon power up, how can I do it?
Sometines I make a GPIO pin for DI,DO, it's not okay that the pin stay always 0 when the board power on, no matter I set the pin mode "input" or "output".
Beta Was this translation helpful? Give feedback.
All reactions