My understanding is that it is reliable but not fully predictable in the sense that you can't guarantee that something between 1.5 and 3V will lead to the same HIGH or LOW on two different boards or that the same input will lead to the same HIGH or LOW if you power supply has somewhat varied between the two reads. But that's just a guess, I've not studied in details how the PORT registers are set electrically
Not weird, it's part of the language, so something good to know
as I said, what you are suggesting will lead to 0 and 1 but it's going to be mostly 0 and only 1 if the input value is read at 1023.
so technically work, but does it match your needs/expectations is the real question.
➜ the expression where you compare the analogRead value lets you set the threshold under which it's 0 and above which it's 1.
➜ the digitalRead() will give you 0 and 1 but you don't get to set the exact threshold
I'll repeat myself but you understand that if you use map() you'll get 0 most of the time and depending on how good the input is, you might never get exactly 1023 and thus never get 1 ?
I would go for the comparison then you have way more control (and it's probably faster than map)
const int threshold1 = 512;
const int threshold2 = 448;
...
digitalWrite(outpin1, (analogRead(A0) > threshold1) ? HIGH : LOW);
digitalWrite(outpin2, (analogRead(A1) > threshold2) ? HIGH : LOW);
you get to have different threshold if needed (depending on your joystick or whatever is connected which might be biased )
What kind of signal is applied to the pin? If it is really an analogue signal, you should include a hyteresis. Otherwise, your digital signal will become unstable when the external voltage equals the threshold voltage.
With digitalRead, there is an internal Schmitt trigger that provides hyteresis.