英文:
How do I link two applications that are not connected in any way, even by programming languages?
问题
I'm a beginner, I'm currently studying arduino and working with it. I have created a small circuit that, at the touch of a button, outputs true (1) or false (0) to the Arduino IDE console. I had an idea: what if I create a python game with a controller on this chip. I have a question: how can I, roughly speaking, pull information from the Arduino IDE console and process it in python code. (From Arduino IDE to PyCharm)
I'm sorry if there was such a question, keep in mind that I'm a beginner
I haven't tried anything because I don't even know what to try :).
I expect taking information from Arduino console, transferring it to python code, and doing something with it.
I can provide you screenshots if you need.
英文:
I'm a beginner, I'm currently studying arduino and working with it. I have created a small circuit that, at the touch of a button, outputs true ( 1 ) or false (0) to the Arduino IDE console. I had an idea: what if I create a python game with a controller on this chip. I have a question: how can I, roughly speaking, pull information from the Arduino IDE console and process it in python code. ( From Arduino IDE to Pycharm )
I'm sorry if there was such a question, keep in mind that I'm a beginner
I havent tried anything because i don
t even know what to try :).
I expect taking information from Arduino console, transferring it to python code and doing something with it.
I can provide you screenshots if you need.
答案1
得分: 1
我建议让Arduino将您想要的数值打印到串行端口,然后让Python连接到Arduino连接的串行端口,并读取发送的数值。我建议使用pyserial
来读取串行数据,因为我以前用它取得了成功的结果。这里是PyPI页面,这里是文档链接。
英文:
I would suggest having the Arduino print the values you want into the serial and then have python connect to the serial, that the Arduino is connected to and read the values being sent. I would recommend using pyserial
to read the serial, as I have had successful results in the past with it. Here is the PyPI page and here is the documentation.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论