简体   繁体   English

覆盆子pi蓝牙和乐高头脑风暴

[英]raspberry pi bluetooth and lego mindstorm

I am trying to get a lego mindstorm ev3 to communicate with a Raspberry Pi. 我正在尝试获取乐高思维风暴ev3与Raspberry Pi进行通信。 I am able to get the mindstorm to send data to the Pi but the data is not human readable. 我能够打起精神将数据发送到Pi,但该数据无法人工读取。 My end goal is to be able to send some sensor information from the mindstorm to the Pi and have the Pi make a decision based on that data. 我的最终目标是能够从头脑风暴中向Pi发送一些传感器信息,并让Pi根据该数据做出决定。 The data I am currently recieving looks like this '\\xof\\x00\\x01\\x00\\x81\\x9e\\x04abc\\x00\\x04\\x00\\x00\\x00\\x00\\x00'. 我当前正在接收的数据如下所示:“ \\ xof \\ x00 \\ x01 \\ x00 \\ x81 \\ x9e \\ x04abc \\ x00 \\ x04 \\ x00 \\ x00 \\ x00 \\ x00 \\ x00”。 This string came from the mindstorm sending the number 1 to the Pi. 该字符串来自头脑风暴,将数字1发送给Pi。

Is there a way I can figure out what this data means so that I can use it to make decisions in python. 有没有一种方法可以弄清楚此数据的含义,以便可以使用它在python中进行决策。

The way the two are connected was done by following the instructions here http://gipprojects.wordpress.com/2013/11/29/using-python-and-raspberry-pi-to-communicate-with-lego-mindstorms-ev3/ . 按照以下说明进行操作,以将两者连接起来: http://gipprojects.wordpress.com/2013/11/29/using-python-and-raspberry-pi-to-communicate-with-lego-mindstorms-ev3 /

The site you linked give a good explanation of how to interpret the data. 您链接的站点很好地解释了如何解释数据。 You should not be looking at is as a string (text), but rather as bytes. 您不应以字符串(文本)为单位,而是以字节为单位。 Each byte has a specific meaning depending on which command you are receiving. 每个字节都有特定的含义,具体取决于您要接收的命令。

For additional information check out the LEGO firmware documentation Communications Overview . 有关其他信息,请查阅LEGO固件文档“ 通讯概述” I am guessing the command you are dealing with is the WRITEMAILBOX System Command . 我猜您正在处理的命令是WRITEMAILBOX 系统命令

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM