Hanso Posted June 3, 2015 Posted June 3, 2015 (edited) Lego doesn't support a message protocol that is interchangeable between the NXT and EV3 brick. To overcome that problem, I have written a small program in C# to make the translation between the two different bricks. It works fine, but you always need a PC in between. At our blog (see https://siouxnetontr...pc-application/), I have written an article with a completely different solution, namely a 'motor communication protocol'. Enjoy. /Hans Edited June 3, 2015 by Hanso Quote
oracid Posted June 4, 2015 Posted June 4, 2015 (edited) That looks very interesting. You say: "The basis of this communication protocol is that the large motors (both at the NXT and the EV3) can either be used as activator (motor movement) and as sensor (rotation)." Can you post a very small program exemple of how to use the EV3 motor as a sensor. Thank you in advance. Edited June 4, 2015 by oracid Quote
PeterF Posted June 4, 2015 Posted June 4, 2015 That's a nice solution. I remember someone doing something similar with two color/light sensors. Since these can both sense light and transmit light. He had a whole communication protocol running I think. Can't find it now though. Quote
Hanso Posted June 5, 2015 Author Posted June 5, 2015 That looks very interesting. You say: "The basis of this communication protocol is that the large motors (both at the NXT and the EV3) can either be used as activator (motor movement) and as sensor (rotation)." Can you post a very small program exemple of how to use the EV3 motor as a sensor. Thank you in advance. You need the MotorRotation programming block, see example below. More information can be found at the help pages of the EV3, search for Motor Rotation. The difference with the color sensor solution: * The NXT color sensor can both send and receive light, the EV3 color sensor is only able to receive light. So you can only have two way communication between two NXT bricks. * You need a sensor port for the color sensor, and in my situation all sensor ports were occupied. /Hans Quote
PeterF Posted June 5, 2015 Posted June 5, 2015 The difference with the color sensor solution: * The NXT color sensor can both send and receive light, the EV3 color sensor is only able to receive light. So you can only have two way communication between two NXT bricks. * You need a sensor port for the color sensor, and in my situation all sensor ports were occupied. Two good points. I did not know that about the EV3 color sensor. How about if you use a NXT color sensor with the EV3 brick? Quote
Hanso Posted June 5, 2015 Author Posted June 5, 2015 I have not tried that, but I think that it should work with the NXT color sensor at the EV3 brick. /Hans Quote
Hanso Posted June 6, 2015 Author Posted June 6, 2015 At my Youtube channel, you find a video with a demo of this 'motor protocol'. This is just a simple demo, I am working on a version with two buttons at the NXT brick and two different actions at the EV3 brick. /Hans Quote
Hanso Posted June 7, 2015 Author Posted June 7, 2015 (edited) Update that demo with two buttons: Pressing the first button on the NXT, the EV3 display starts to flashing red. Pressing the second button on the NXT, the EV3 starts spinning the 24-tooth gear. When the action is done at the EV3 side, a "done" message is send back and the NXT sounds a 'beep'. Let me know what you think. /Hans Edited June 7, 2015 by Hanso Quote
Hanso Posted June 7, 2015 Author Posted June 7, 2015 And the final version: the color selector. On the NXT, a color sensor reads the chosen color. This information is passed with the use of two motors to the EV3, that displays the chosen color and plays the corresponding sound file. When done, this is passed back to the NXT (and you hear 'yes'). Enjoy. /Hans Quote
oracid Posted June 8, 2015 Posted June 8, 2015 I do not understand why you use two motors to transfer a data. But I must say that my knowledges are very small. I find this very interesting but not understand the goal. Moreover, with the code, it would be even more interesting. Quote
laggyluk Posted June 8, 2015 Posted June 8, 2015 (edited) I guess ev3 color sensors could be used in light strength measurement mode for binary protocol, dunno if nxt sensor can do that though The difference with the color sensor solution: * The NXT color sensor can both send and receive light, the EV3 color sensor is only able to receive light. So you can only have two way communication between two NXT bricks. * You need a sensor port for the color sensor, and in my situation all sensor ports were occupied. /Hans ok nevermind then Edited June 8, 2015 by laggyluk Quote
Hanso Posted June 9, 2015 Author Posted June 9, 2015 I do not understand why you use two motors to transfer a data. But I must say that my knowledges are very small. I find this very interesting but not understand the goal. Moreover, with the code, it would be even more interesting. You don't need to use two motors, it can also be done with one motor and the number of degrees. But I assume that this is less accurate after some time. The goal is to connect two bricks without Bluetooth or WiFi and how easy it is to create your own protocol. /Hans Quote
oracid Posted June 9, 2015 Posted June 9, 2015 (edited) You don't need to use two motors, it can also be done with one motor and the number of degrees. But I assume that this is less accurate after some time.The goal is to connect two bricks without Bluetooth or WiFi and how easy it is to create your own protocol. Ok, I see what is the goal now, but why don’t you use the sensors plugs instead of the motors. Edited June 9, 2015 by oracid Quote
Hanso Posted June 9, 2015 Author Posted June 9, 2015 In the final layout, the brick that is used to 'send' the messages to the other brick, has no free sensor ports. That is the reason. And using the light sensor has always the risk of wrong interpretation of the color. /Hans Quote
oracid Posted June 10, 2015 Posted June 10, 2015 Ok, I understand. And what about using a motor in the nxt and a push button on the ev3 ? And more, I don't understand how the nxt motors transfers the value to the ev3 motors. I believe the answer is in the code. Quote
Hanso Posted June 11, 2015 Author Posted June 11, 2015 (edited) Ok, I understand. And what about using a motor in the nxt and a push button on the ev3 ? And more, I don't understand how the nxt motors transfers the value to the ev3 motors. I believe the answer is in the code. The answer is (partly) in de code. The answer is mostly in the fact that ... ... the motors are physically connected (so if the EV3 motor rotates, the NXT rotates as well and vice versa). ... the motors can be use as actuator (= motor) and sensor (measure the number of degrees) So, if I want to pass a message from the NXT to the EV3, I let the NXT motor rotate (e.g. 90 degrees). The EV3 motor 'notices' the number of degrees and can act upon it, for example +90 degrees is action#1 and -90 degrees is action#2. Hope this makes sense ;-) If not, please let me know or send me an email if you want the NXT/EV3 source code. /Hans Edited June 11, 2015 by Hanso Quote
oracid Posted June 11, 2015 Posted June 11, 2015 The EV3 motor 'notices' the number of degrees and can act upon it, for example +90 degrees is action#1 and -90 degrees is action#2. This is very great Hans. I understand now. Thank you very much. Quote
Hanso Posted June 14, 2015 Author Posted June 14, 2015 The code can be found here: NXT code: https://www.dropbox.com/s/f4q218n6jay5lop/MotorProtocolNXT%20v2.rbt?dl=0 EV3 code: https://www.dropbox.com/s/lxsppjjk5qorzsg/MotorProtocolEV3%20v2.ev3?dl=0 If you have any questions, please let me know. /Hans Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.