使用Processing绘制鼠标的xy坐标图
我发现这个非常酷的网站将 Arduino 连接到光电鼠标以从中读取 xy 读数。我已经做到了,而且效果很好。
然后我在想,“为什么不将所有这些绘制成图表呢?”我遇到了处理。
我知道处理有一个名为“MouseSignal”的示例,
这个示例正是我想用处理编写的东西。但是,唯一的变化是,我想使用连接到 Arduino 的鼠标的 xy 坐标,并要求处理生成坐标的“实时”图表。
谢谢!
I've found this really cool site on interfacing an Arduino to an optical mouse to read out x-y readings from it. I've done it, and it's working nicely.
Then I was thinking, 'Why not plot all this to become a graph?' and I came across Processing.
I am aware that Processing has an example named 'MouseSignal'
This example is the EXACT thing that I want to write with Processing. But, the only change is that, I want to use the x-y coordinates from the mouse that is attached to the Arduino and ask Processing to generate a 'real-time' graph of the coordinate.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
更改代码中的位置:
将
mouseX
和mouseY
替换为来自 Arduino 的值。您可能需要缩放这些值以适合轴。Change the spot in the code where it says:
Replace
mouseX
andmouseY
with the values coming from the Arduino. You may need to scale these values to fit within the axes.