LEGO decided to make communication between EV3 and NXT very difficult.
The Bluetooth protocol is different and both controllers act as I2C master.
Searching at internet I found 2 solutions.
1: Use a PC as Bluetoothmailbox.
see: https://siouxnetontrack.wordpress.com/2015/03/07/using-the-nxt-as-remote-control-for-the-ev3/
2: Connect two motors and count the decoders.Another solution is, use a dual port I2C memory chip.
Unfortunately these are no for sale.
Because there are no bit-bang I2C slave software library's for Arduino, we need a micro controller with 2 hardware I2C slave ports, programmed as dual port memory.
The ATmega328PB 5V 16mHz chip has 2 Serial, 2 SPI, 2 I2C hardware ports and is very cheap.
Also a Teensy 3.2/3, 5 can be used, as long as it does have 5V tolerant I/O.
A Teensy 3.5 with 3 I2C ports, you can even connect 2 NXT's to your EV3.
In this case I ordered a Wattuino Pro-micro 328PB, installed the Arduino board driver.
see: https://github.com/watterott/ATmega328PB-Testing
and made a Arduino program for it: EV3toNXT.ino.
Now connect the EV3 I2C port to A4-A5 and the NXT to PE0 and PE1 with 4 82k Resitors to Vcc see and ground connections. see: schematic.
For the Dual port communication I made an EV3-G block: EV3toNXT.ev3b
Also added are some examples for testing; EV3toNXT-examples.zip
Limitations: only: Boolean, Byte and INT32 numbers can be send or received.
So Floating points with decimals can not be send or received, only whole number positive or negative.
Why: the EV3-G block builder has no type casting or conversion from float to bytes. It does only have Number to String but not String to Number conversion.
Warning: Do not connect the 5 Vcc to the ATmega328PB board util you programmed, tested and disconnected the USB to Serial converter. Otherwise you blow up your EV3, NXT or Atmega328PB board.
The Pololu A-start 328PB cann't be used, because there software doesn't support a second I2C port.
Comments