EasyC - Jumpers and LEDs

I guess I’m posting to ask, “is this for real?”

When a jumper is inserted into a port, GetDigitalInput(port) returns 0?

Also, to turn on an LED you set it to 0, not 1?

This is how my code is behaving. Why is this so and why is it not documented? It had me scratching my head for a while. I actually thought there was a problem with my code at first.

This is all correct.

With a digital input the signal line is connected through a resistor to the +5V power so it normally reads as a “1”. When you close a switch you connect the signal line to 0V and so it reads as a “0”.

The led is similar, one side is connected to +5V, the other side is switched so you need to connect it to 0V by setting it to a “0” to make a circuit.

Thank you for the explanation. Is this how it works in RobotC as well?

Yes, it’s a very “standard” way of dealing with digital IO on all sorts of embedded systems.