Hi,
I want to use an external switch to activate a function in Lua script. The idea is to use the switch between the 5v reference and GPIO #1. Do I need to use any sort of resistor, or the 5v straight into the GPIO port would be fine?
Thanks
Paulo
GPIO - 5V reference
Moderators: JeffC, rdoherty, stieg, brentp
I would recommend connecting it this way:
1 - 100K pullup resistor between GPIO input and 5v (resistance is not critical)
Switch connected between input and ground
This way, when the switch is open, the pullup resistor pulls up to 5v, and when the switch is closed, the input is pulled to ground.
Hope this helps, let us know how the project goes!
1 - 100K pullup resistor between GPIO input and 5v (resistance is not critical)
Switch connected between input and ground
This way, when the switch is open, the pullup resistor pulls up to 5v, and when the switch is closed, the input is pulled to ground.
Hope this helps, let us know how the project goes!