How do I link two applications that are not connected in any way, even by programming languages?

huangapple go评论62阅读模式
英文:

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 How do I link two applications that are not connected in any way, even by programming languages?

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 How do I link two applications that are not connected in any way, even by programming languages?

I havent tried anything because i dont 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.

huangapple
  • 本文由 发表于 2023年6月8日 04:06:01
  • 转载请务必保留本文链接:https://go.coder-hub.com/76426775.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定