Project showcase

Arduino ♥ Linux (on UP2 Board) with Intel Mraa © CC BY-NC-SA

Use libArduino and MRAA to interact with the board OS and report some nice stats with LEDs.

  • 1,438 views
  • 0 comments
  • 5 respects

Components and supplies

Apps and online services

About this project

About

This experiment shows how to interact with a Linux Single Board Computer (UP^2 in this case) using Arduino language and Create Web Editor. To begin, we need a suitable OS running on the board. As of writing, we need to install UbiLinux 4.0 beta 2 to be able to access all the IO functionalities of the board.

Steps

Get an USB stick and follow the Getting Started section of Arduino Create. Select UbiLinux as target OS and follow the instructions. After about 30 minutes your UP^2 will be ready to host any Arduino sketch. To make sure not to break anything, power down the board before connecting the LEDs.

We are going to use a couple of GPIOs and the three PWM channels exposed by the Apollo Lake platform. As GPIOs, we'll use pins 8 and 10, while exported PWMs are on pins 16, 32 and 33. Pin numbering starts from upper right corner (looking at the board with the expansion connector on the bottom) and follows the typical zig-zag scheme. The pin mapping resembles the Raspberry Pi 40 pin GP-bus, so any illustrator the the RPi will just apply fine.

Once the LEDs have been connected (remember the series resistor to avoid absorbing too much current) power up the board, wait for the boot to finish and open the attached sketch using Create. From the dropdown menu you should see an additional board, which name matches the one you chose at the end of the GettingStarted procedure.

Press upload to load the sketch and launch it on the board. All this procedure can be performed remotely; you don't need to be in the same local network of the board. You can also start and stop the execution as you wish from the "My Devices" section of Create landing page. Once the sketch is loaded, it will poll some well known Linux command line utilities to get the Ethernet adapters status (if a cable is connected) and the system load.

Finished

The load average (for the last 1, 5 and 15 minutes) is mapped as a value between 0 and 255 and these values are associated to the LEDs brightness. At a glance you can see if the board is being overloaded by some other task and maybe take some actions (like spinning an alternative cooling system).

Code

Linux Arduino Integration demo

Schematics

Cabling
Up2 leds bb gnal6juocf

Comments

Similar projects you might like

Arduino Uno-Based, Easy-to-Build Pet Feeder

Project tutorial by edr1924

  • 998 views
  • 1 comment
  • 13 respects

HOW PIR SENSOR WORK

Project tutorial by DIY Partners

  • 1,747 views
  • 5 comments
  • 16 respects

4-Stroke Digital Clock With Arduino

Project tutorial by LAGSILVA

  • 7,138 views
  • 8 comments
  • 30 respects

Dead Bug Valentine

Project tutorial by wrightmac

  • 906 views
  • 0 comments
  • 7 respects

Low Cost Accurate 3D Positioning

Project tutorial by Sumit Aich

  • 4,340 views
  • 5 comments
  • 7 respects
Add projectSign up / Login