Android USB 位计数器
我想将簧片开关连接到 HTC evo 上的 USB 端口。我想确定 USB 端口上的两个引脚何时具有相同的电位,或者将一个小电池连接到开关并读取高值和低值。最终我希望能够在不改变内核的情况下做到这一点。如果这是不可能的,我的替代方案是使用耳机插孔。基本上我需要一种读取外部输入的方法。如果这两种选择都不可行,您能否建议一种方法来做到这一点。由于项目的原因,我需要使用簧片开关,没有办法解决这个问题。
谢谢 吉姆
I would like to connect a reed switch to the USB port on my HTC evo. I would like to either determine when two of the pins on the USB port are the same potential or, connect a small battery to the switch and read the high and low values. Ultimately I would like to be able to do this with out altering the kernel. If this is not possible, my alternative would be to use the headphone jack. Basically I need a way to read external input. If neither of these options are possible, can you suggest a way to do this. Because of the project, I'll need to use the reed switch, no way to get around that.
Thank you
Jim
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能需要阅读一下 USB 。这是一个非常“智能”的系统,远远超过旧的愚蠢的并行端口,这似乎更像你想要的。典型的USB端口只有四个导体(引脚);电源线、地线和两条差分电压信号线。你不能对数据线进行“位敲击”,这是一种太低级的操作。
我建议使用耳机端口中的麦克风信号,这至少应该为您提供模拟输入。您可能需要对开关的输出进行偏置或电压转换,以适应麦克风的输入特性。
You probably need to read up on USB a bit. It's a very "intelligent" system, far more so than the old dumb parallel port which seems to be more like what you want. There are only four conductors (pins) in the typical USB port; power, ground, and two differential-voltage signalling lines. You can't "bit-bang" the data lines, that's way (way) too low-level an operation.
I would recommend going with the microphone signal in the headset port, that at least should give you an analog input. You might need to bias or voltage-shift the switch's output to suit the input characteristics of the microphone.