WPF button that sends string to Serial Port

陌路散爱 提交于 2019-12-13 05:31:00

问题


Hi there I have a question regarding sending a string that will command an old 80s robot. I have made the connection to the robot via USB-Serial Port with help from you guys :)

Now I need to assign different strings of code that look like this :":01013100010010"

Every single code controls one of the six step-motors of the robot.

I need help assigning different commands to 6 (I have 6 motors) different "+" and "-" buttons that will control the robot to go for example left or right.

Another I don't know is should I use the "button1_Click" or "button1_MouseDown and up"? All I need is to click on the button and the robot to go 1 step left or one step right, not all the way it can go to left or right.

Hope you guys can help!

Thanks!


回答1:


I think it depends on the the device your controlling the device would likely need some sort of driver to communicate since it will likely require COM Interop at minimum due to the age

if your trying to hack your way through it your going to have a much more difficult time unless you have the protocol documentation

if you have determined that you can communicate with your BOT then this article may help you out

also if there is a compatible driver for it you may want to try out Microsoft Robotics Studio which could help you with some of the cotrol code for your robot, judging from the age it sounds to be a bit unlikely there will be a compatible driver for it tho



来源:https://stackoverflow.com/questions/19640442/wpf-button-that-sends-string-to-serial-port

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!