OpenRoberta / openroberta-lab

The programming environment »Open Roberta Lab« by Fraunhofer IAIS enables children and adolescents to program robots. A variety of different programming blocks are provided to program motors and sensors of the robot. Open Roberta Lab uses an approach of graphical programming so that beginners can seamlessly start coding. As a cloud-based application, the platform can be used without prior installation of specific software but runs in any popular browser, independent of operating system and device.
Apache License 2.0
124 stars 121 forks source link

Integrate Arduino Uno Wifi Rev2 #332

Closed boonto closed 4 years ago

boonto commented 4 years ago

As the Wifi Rev2 edition of Arduino seems not to work with our current Uno plugin we have to adapt a specific one for the Wifi Rev2 edition.

boonto commented 4 years ago

Similar to the festobionic implementation a different compiler is needed. As the atmega4809 specs and libs are not part of the default avr-gcc implementation of Ubuntu, we need the modified one from Arduino. A link to the compiler can be found here in the ArduinoIDE packages. With these commands I added it to my path:

cd ~
wget http://downloads.arduino.cc/tools/avr-gcc-7.3.0-atmel3.6.1-arduino5-x86_64-pc-linux-gnu.tar.bz2
mkdir -p ~/avr-gcc
cd ~/avr-gcc
tar -xf ~/avr-gcc-7.3.0-atmel3.6.1-arduino5-x86_64-pc-linux-gnu.tar.bz2
rm ~/avr-gcc-7.3.0-atmel3.6.1-arduino5-x86_64-pc-linux-gnu.tar.bz2
echo "export PATH=\$PATH:\$HOME/avr-gcc/avr/bin" >> ~/.profile

Next, I uninstalled our recommended avr-gcc to use the custom one instead.

I also added functionality to the robot.plugin.compiler.linux.dir property which can be used to have both compilers running at the same time. However, all of our integration tests run with the newer compiler version as well so we could replace it altogether (after more testing of course).

As the Arduino Uno Wifi Rev2 inbuilt LED is not on pin 13 but on 25 and 25 is not available on the board, I also added a new entry to the LED dropdown BUILTIN_LED, similar to the Arduino constant used in e.g. the Blink example.

boonto commented 4 years ago

The avrdudes working with the Wifi Rev2 are also linked in the package index:

boonto commented 4 years ago

Compilers for OSX, Windows and Linux ARM 32 can also be found there.

boonto commented 4 years ago

I tested the compiler and avrdude on Windows, both worked with standard Uno, Uno Wifi Rev 2 and BOB3. Additional compiler resources are not needed.

boonto commented 4 years ago

Linux ARM compiler also seems to work, tested on a Raspberry Pi 4 and compiled for all avr-gcc robots.

boonto commented 4 years ago

Connecting via Raspberry also works.

For the IMU the additional library Arduino_LSM6DS3 is necessary.

boonto commented 4 years ago

The previously mentioned library does not include the inbuilt temperature sensor, because of that the library by SparkFun will be used instead.

boonto commented 4 years ago

In order to not pollute the other Arduinos for now the gyro and accelerometer blocks can be added to the program with CTRL-6. This will create the two program and config blocks.

bjost2s commented 4 years ago

works fine with latest openroberta-connector