I'm trying to get the output of 2 very fast momentary on switches into a computer.
Suggestions?
I also have to somehow deal with the fact the two switches are compressed onto two contacts somehow, but specifically as in the attached file, although I'm not sure that worked so it's also here:
https://www.audiofront.net/forum/viewto ... 256#p11256
(Note the piezo output can just be processed by normal audio line in, so that is ignorable.)
Thanks,
-Danny
Is MCP2221A best product for getting switch output quickly i
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- djbclark
- Posts: 2
- Joined: Sun Jul 03, 2022 5:13 pm
Is MCP2221A best product for getting switch output quickly i
- Attachments
-
- yammi2.jpg (18.14 KiB) Viewed 235 times
- djbclark
- Posts: 2
- Joined: Sun Jul 03, 2022 5:13 pm
Re: Is MCP2221A best product for getting switch output quick
Looking around a bit more I'm thinking maybe MCP4728 would be better, as it could actively provide a voltage to put through and thus detect if it is the switch behind the resistor or not. That sound right?
- sj_remington
- Posts: 994
- Joined: Mon Jul 27, 2020 4:51 pm
Re: Is MCP2221A best product for getting switch output quick
To decide whether the edge or bell switch is closed, you can measure the current flow to ground. A voltage divider and an analog input (on a microprocessor or the MCP2221) will work. Connect one end of a 10K resistor to a suitable voltage source (Vcc) and the other to the switch lead and the analog input. Don't forget to connect the grounds.
Voltage = Vcc (both open)
Voltage = Vcc/2 (edge closed)
Voltage = 0 (bell closed)
Note that this method does not allow you to tell if both switches are closed.
Voltage = Vcc (both open)
Voltage = Vcc/2 (edge closed)
Voltage = 0 (bell closed)
Note that this method does not allow you to tell if both switches are closed.
Please be positive and constructive with your questions and comments.