Download - Virtual Machine for Lego Mindstorm - Disi
![Page 2: Virtual Machine for Lego Mindstorm - Disi](https://reader030.vdocument.in/reader030/viewer/2022021007/62039a12da24ad121e4b4f33/html5/thumbnails/2.jpg)
Prerequisites
Software:
• VirtualBox > 4.2.6
• VirtualBox Extension Pack
Available at https://www.virtualbox.org/wiki/Downloads
Hardware:
• Bluetooth dongle
• 1 USB port available
• 12 GB free
![Page 3: Virtual Machine for Lego Mindstorm - Disi](https://reader030.vdocument.in/reader030/viewer/2022021007/62039a12da24ad121e4b4f33/html5/thumbnails/3.jpg)
Get VM
1. Download the VM (≈3.5 GB archive): LAN: http://net-server01.dit.unitn.it/~colombo/Ubuntu-12.04.1.rar
Dropbox : http://alturl.com/884tf
2. Extract it to your hard drive, 12 GB needed
![Page 4: Virtual Machine for Lego Mindstorm - Disi](https://reader030.vdocument.in/reader030/viewer/2022021007/62039a12da24ad121e4b4f33/html5/thumbnails/4.jpg)
Run VM
• Open Ubuntu-12.04.1.vbox from VirtualBox
• Standard VM configuration:
– 1024 MB RAM/1 CPU
• Start it!
![Page 5: Virtual Machine for Lego Mindstorm - Disi](https://reader030.vdocument.in/reader030/viewer/2022021007/62039a12da24ad121e4b4f33/html5/thumbnails/5.jpg)
Log-in
Credentials to login:
• User: ubuntu
• Password: eecs
![Page 6: Virtual Machine for Lego Mindstorm - Disi](https://reader030.vdocument.in/reader030/viewer/2022021007/62039a12da24ad121e4b4f33/html5/thumbnails/6.jpg)
Connect Bluetooth dongle to VM
• Apple users: read Bluetooth issues.txt on the VM desktop!
• Should be an USB device, for example:
• BT icons should show up in the toolbar:
• If not…
![Page 7: Virtual Machine for Lego Mindstorm - Disi](https://reader030.vdocument.in/reader030/viewer/2022021007/62039a12da24ad121e4b4f33/html5/thumbnails/7.jpg)
Issues with Bluetooth dongle
If the device is busy e.g.:
Then:
1. Shutdown VM properly:
2. Disable any software on the host using BT
3. Turn VM on and try again
![Page 8: Virtual Machine for Lego Mindstorm - Disi](https://reader030.vdocument.in/reader030/viewer/2022021007/62039a12da24ad121e4b4f33/html5/thumbnails/8.jpg)
Connect Lego brick
1. Turn brick on (orange button)
2. Connect USB cable to your computer
3. Enable the brick (0694:0002) in VirtualBox
1. A popup should appear
![Page 9: Virtual Machine for Lego Mindstorm - Disi](https://reader030.vdocument.in/reader030/viewer/2022021007/62039a12da24ad121e4b4f33/html5/thumbnails/9.jpg)
Open LEGO terminal
1. Double-click on “LEGO Minstorm terminal”
2.
![Page 10: Virtual Machine for Lego Mindstorm - Disi](https://reader030.vdocument.in/reader030/viewer/2022021007/62039a12da24ad121e4b4f33/html5/thumbnails/10.jpg)
Setup
Check LEGO brick firmware version:
• Type setup_brick in the LEGO terminal and run it, carefully follow instructions. Type “yes” if firmware is outdated!
Download bluetooth client for data streaming:
• Type download_bt_client in that terminal and run it.
![Page 11: Virtual Machine for Lego Mindstorm - Disi](https://reader030.vdocument.in/reader030/viewer/2022021007/62039a12da24ad121e4b4f33/html5/thumbnails/11.jpg)
Setup - II
• Enable Bluetooth on the brick and make it visible:
– Bluetooth > Visibility > Visible
• Connect a motor to port B
![Page 12: Virtual Machine for Lego Mindstorm - Disi](https://reader030.vdocument.in/reader030/viewer/2022021007/62039a12da24ad121e4b4f33/html5/thumbnails/12.jpg)
Configure BT streaming
1. Type load_scicoslab in the LEGO terminal and run it. Let ScicosLab load in background.
2. Type start_bt_server and run it, carefully read printed text until Ready for client connect() appears.
3. [BT] should appear on the brick screen (wait)
1 2 3
![Page 13: Virtual Machine for Lego Mindstorm - Disi](https://reader030.vdocument.in/reader030/viewer/2022021007/62039a12da24ad121e4b4f33/html5/thumbnails/13.jpg)
Test BT streaming
1. Move to ScicosLab window.
2. Type scicos sample/read_tacho.cos and run it.
3. Run client on the brick: press right gray arrow
4. Run Scicos block [Simulate > Run]:
![Page 14: Virtual Machine for Lego Mindstorm - Disi](https://reader030.vdocument.in/reader030/viewer/2022021007/62039a12da24ad121e4b4f33/html5/thumbnails/14.jpg)
Test BT streaming - II
• If everything is configured correctly you should see the Y changing if you rotate manually the motor.
![Page 15: Virtual Machine for Lego Mindstorm - Disi](https://reader030.vdocument.in/reader030/viewer/2022021007/62039a12da24ad121e4b4f33/html5/thumbnails/15.jpg)
nxtOSEK and ARM toolchain
• Open LEGO terminal
• ARM toolchain is already reachable:
– arm-elf-[gcc, g++, ld, cc, c++, …]
• The nxtOSEK directory is: ~/NXT/nxtOSEK/
• Helloworld template, go to:
– ~/NXT/nxtOSEK/dev/helloworld
• Try it!
– Compile and flash: run make all then ./rxe_flash.sh
– Run it on the brick: [My Files > SW Files > Helloworld_OSEK]