如何使用Windows作为树莓派并将Windows与另一个树莓派连接 [英] How to use windows as raspberry pi and connect the windows with another raspberry pi

查看:216
本文介绍了如何使用Windows作为树莓派并将Windows与另一个树莓派连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Python 3,我想从第一个raspi发送输入并更改第二个raspi的输出。例如,有一个按钮,当我按下该按钮时,我想在屏幕上看到一条消息,当我松开按钮时,我想更改屏幕上的消息。到目前为止,我已正确完成了所有操作。现在,我想使用第一个raspi作为按钮,并且我希望在第二个raspi上看到和更改消息。但是问题是是ı没有第二个raspi,我的老板说ı可以将我的窗户/笔记本电脑用作第二个raspi。我找不到该怎么做–

I'm using Python 3,ı want to send input from first raspi and change the output from second raspi.For example ı have a button,when ı press the button,ı want one message to be seen on the screen,when ı release the button ı want the message on the screen to be changed.I did everything correctly up to here.Now I want to use first raspi as button and ı want the messages to be seen and changed on second raspi.But the problem is that ı don't have second raspi,my boss said that ı could use my windows/laptop as second raspi.I could not find how to do that –

推荐答案

您不能将Windows用作树莓派。

You can't "use windows as a raspberry pi".

老板可能的意思是在您的代码上运行相同的代码自己的计算机并让Pi与之通信...

What your boss probably meant was to run the same code on your own computer and have the Pi communicate with it...

您需要研究使用 socket 模块或SocketIO或ZMQ之类的库,您的Windows计算机将在其中侦听某个端口上的传入请求,并且树莓派会d必须明确连接到远程计算机上的该端口

You would need to look into using the socket module or a library like SocketIO or ZMQ, where your Windows machine would "listen" for incoming requests on some port, and the raspberry pi would have to connect explicitly to that port on the remote machine

如果用屏幕表示网络浏览器,则只需使用Javascript来更新显示,然后支持的API服务器(任何语言)都会存储您的更改

If by "screen" you mean a web browser, then you would just use Javascript to update the display, and the backing API server (of any language) would store your change

这篇关于如何使用Windows作为树莓派并将Windows与另一个树莓派连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆