An adapter allow HuskyLens communication with LEGO Mindstroms EV3 (support SPIKE/RI).
The EV3/SPIKE/RI using LEGO UART protocol to communicate with sensors, and HuskyLens provide I2C and UART to transmit data, so we use an Arduino as an "Translator", to convert HuskyLens data to LEGO UART format.
We use an Arduino Pro Mini, and a simple PCB to connect HuskyLens pins and EV3 ports.
- Arduino Pro Mini 5V, 16 MHz with baud 115200 for EV3
- Arduino Pro Mini 3v3, 8 Mhz with baud 57600 for SPIKE/RI
- HuskyLens and Arduino communicate with baud 9600 (swuart)
Using avrdude or XLoader to upload firmware hex file to your Arduino Pro Mini, if you using ICSP to program your arduino, you can choose "_with_Bootloader" one hex file to programming to keep the bootloader there.
For XLoader users: You can add this line into device.txt to upload bin file to Pro Mini. (Tested, works fine.)
"Pro mini(ATmega328);m328p;stk500;57600;"
Go to release page to download EV3-G blocks, the block will return following info:
- For a block:
Connection status
see Connection Status Code belowID
ID of BlockX
X Center of BlockY
Y Center of BlockW
Width of BlockH
Height of Block
- For an arrow:
Connection status
see Connection Status Code belowID
ID of Arrowx1
X Origin of Arrowy1
Y Origin of Arrowx2
X Target of Arrowy2
Y Target of Arrow
Code | Means |
---|---|
9 | Adapter connected but HuskyLens not. |
8 | Connection is OK but no objects learned. |
7 | Connection is OK and objects is learned, but no objects appears. |
1 | Objects found. |
0 | Port not connected or data loss. |
----- | Port not connected or data loss. |
LEGO® is a trademark of the LEGO Group of companies which does not sponsor, authorize or endorse this software. The LEGO Group and contributors to this repo are not liable for any loss, injury or damage arising from the use or misuse of the provided code or hardware.