I'm very new to Arduino and running into a probably stupid question...
I'm trying to read the button input simply as in the attached image, but when the button is pressed, there isn't any signal... However, when I change line 5 from "INPUT" to "INPUT_PULLUP", the signal shows even if it is reversed 1 and 0. I fail to understand why...
I'm using a 2-pin push button on a real Arduino, but it didn't work, so I try to replicate it in the emulator. My goal is to get a signal 0 when the button is not pressed and a 1 when it is pressed...
Actually, I'm not getting anything but 0 with the schematic I showed... But when I have INPUT_PULLUP instead of the INPUT, I have the reversed as you said...
That's not reversed. For some reason people really want the pressed button to read 1. 1 has to mean on and 0 has to mean off. But it isn't this way. The more common way to wire a button is to have it connect to ground so it reads 0 when pressed and 1 when not pressed. There are several engineering reasons for this. But the point is not to get caught thinking that 1 and on are always linked.