Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting an Input Pin to High would be helpfull of a Warning of the Arduino IDE Software #11647

Open
DanielHaltiner opened this issue Aug 13, 2021 · 3 comments
Labels
Component: Core Related to the code for the standard Arduino API feature request A request to make an enhancement (not a bug fix)

Comments

@DanielHaltiner
Copy link

Arduino IDE Version: 1.8.15
Arduino Hardware: Arduino Nano Every

If you write "digitalWrite (X, HIGH) to a Pin, which has accidentaly defined as an input the processor will set the output, but only a low current commes from this "Fake Output".

It would be very helpfull, if the IDE Software would give a Warning/Input, that in the code is a "digitalWrite" which writes to an Input...
(By defining the analog Inputs I defined the Digital 6 Output further below in the VoidSetup acidentaly again as an Input. This creates an Output half alive... Or I was to dumb to make right code)

WCB-TRM21Software_V0.1.12.zip

@per1234 per1234 added Component: Core Related to the code for the standard Arduino API feature request A request to make an enhancement (not a bug fix) labels Aug 13, 2021
@dsyleixa
Copy link

dsyleixa commented Sep 2, 2021

I double that, and as a workaround I meanwhile use sth like
#define digitalWriteX(p,v) {pinMode(p, OUTPUT); digitalWrite(p,v);} // 'X' for "eXtended"

(similar things for digitalReadX(), digitalReadXpu(), digitalReadXpd() ) // also for RPi + wiringPi

@hossians
Copy link

hossians commented Sep 3, 2021

Writing a high to an input activates the Pull Up, and as I use that very frequently I would be annoyed by such a warning.

@DanielHaltiner
Copy link
Author

DanielHaltiner commented Sep 3, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Core Related to the code for the standard Arduino API feature request A request to make an enhancement (not a bug fix)
Projects
None yet
Development

No branches or pull requests

4 participants