I have wired an 8 way rotary switch with resistors between each pin to create a multi load voltage divider. 3.3v on one side and GND on the other. One analog pin for 8 variations. Anyway... when analog reading; position 1 floats between 0-5 and position 8 stays at 4095. The switch is continuous so I can switch between position 1 and 8. When I switch between position 1 and 8 ie going from low to high or high to low the pyboard reboots.
Using pin X1
Any ideas why this is happening?
I've worked around the problem by putting another resistor between 3.3v and pin 1. Just through it was a weird phenomena.
Analog read reboots pyboard ?
Re: Analog read reboots pyboard ?
I assume the switch shortened 3.3v and GND during the 1-8 transition, and adding the resistor solved that.
Re: Analog read reboots pyboard ?
Mechanical switches come in two varieties (besides the throws and poles).
You can get a "make before break" switch or a "break before make" switch. It sounds like you have the former, which will briefly short the 2 positions when switching between them. If these happen to be 3.3v and ground, then this short, even though of a very small duration, will reboot your microprocessor.
The second kind of switch (break before make) won't short the inputs together, but will leave the output (of the switch) floating, not connected to anything during the switch.
You can get a "make before break" switch or a "break before make" switch. It sounds like you have the former, which will briefly short the 2 positions when switching between them. If these happen to be 3.3v and ground, then this short, even though of a very small duration, will reboot your microprocessor.
The second kind of switch (break before make) won't short the inputs together, but will leave the output (of the switch) floating, not connected to anything during the switch.
Re: Analog read reboots pyboard ?
Thanks guys. I know all that. Should have realised.
Cheers
Cheers