The following tutorials show how to compile and run native programs written in C for the Lego Mindstorms EV3 kit. It is important to master all the steps shown in this section for for compiling, uploading and running programs described here, as it will be used in all the subsequent sections.
PLEASE BE AWARE THAT ALL THE CODE IN THIS WEB SITE IS EXPERIMENTAL, USE IT AT YOUR OWN RISK!
Cross Compiler Installation
The ARM cross compiler program can be downloaded from this link or using the command:
wget -c http://www.codesourcery.com/sgpp/lite/arm/portal/package4571/public/arm-none-linux-gnueabi/arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
Create a directory that will contain the program:
Uncompress the compiler installation file using:
tar -jxvf ~/arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 -C ~/CodeSourcery/
Add the compiler path using:
echo export PATH=~/CodeSourcery/arm-2009q1/bin/:$PATH >> ~/.bashrc && . ~/.bashrc
We recommended using Bricxcc for compiling and downloading programs to the EV3 brick. At the moment, support for the EV3 brick is only available in the test versions. The latest one that we have tested is test_release20131007.zip. Keep in mind that the zip file contains only part of the software needed for EV3 programing. There is a lengthy list of instructions of how to setup Bricxcc and the CrossCompiler under Windows in the readme_1st.txt file. Make sure to follow all the instructions at least up to step 21. For those not familiar with Windows path manipulation, I found this useful tutorial.
Writing the First Program for the EV3
In order to start programing and testing for the EV3, users will need the following hardware:
- NetGear WNA1100 USB WiFi dongle
- MicroSD card (2GB is plenty)
Next, we need to establish a network connection. This will be used to transfer and run programs remotely in the EV3 brick. Once this is done, you can write and run a “Hello World!” program. You can now move to the next section that shows how interact with the EV3 hardware .