datguy.dev
Member
Greetings,
I have a Teensy LC HID project going on. For additional I/O, I wanted to use a two-way rocker switch which could both power on the device and provide two more inputs. (2 birds one stone as space is very limited in the project case) For example, currently I have the middle main terminal of the rocker switch connected to the negative of a battery. Then I have two leads for each of the other two output terminals on the switch which are then soldered to the boards inputs. I can't run wires from the two posts to grounds as they will not be independent signals... Amazingly enough, this still powers on the board!
In code, I have it light an LED that changes colors to determine which pin (internal pullup) is pulled low. One pin reads correctly and lights the LED correctly for one mode. The other pin, other mode, or other rocker switch setting, doesn't work - unless I add an additional ground from the battery to another negative circuit. But THEN, the Teensy doesn't power off when the rocker switch is disabled. So I really don't know what to do at this point to fix the one side of the rocker switch. I've been playing around with additional ground here or there or resistors etc.
(Side note, serial printing is not working for whatever reason. It would help to see the state of the pin(s). It's setup right in Linux, ports, code, buad rates, quality USB cables, etc. Just refuses to work.)
I have a Teensy LC HID project going on. For additional I/O, I wanted to use a two-way rocker switch which could both power on the device and provide two more inputs. (2 birds one stone as space is very limited in the project case) For example, currently I have the middle main terminal of the rocker switch connected to the negative of a battery. Then I have two leads for each of the other two output terminals on the switch which are then soldered to the boards inputs. I can't run wires from the two posts to grounds as they will not be independent signals... Amazingly enough, this still powers on the board!
In code, I have it light an LED that changes colors to determine which pin (internal pullup) is pulled low. One pin reads correctly and lights the LED correctly for one mode. The other pin, other mode, or other rocker switch setting, doesn't work - unless I add an additional ground from the battery to another negative circuit. But THEN, the Teensy doesn't power off when the rocker switch is disabled. So I really don't know what to do at this point to fix the one side of the rocker switch. I've been playing around with additional ground here or there or resistors etc.
(Side note, serial printing is not working for whatever reason. It would help to see the state of the pin(s). It's setup right in Linux, ports, code, buad rates, quality USB cables, etc. Just refuses to work.)