element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Personal Blogs
  • Community Hub
  • More
Personal Blogs
Legacy Personal Blogs Getting started with the RIoTboard: Hello, LED!
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: charlotte_godley
  • Date Created: 8 Oct 2014 7:16 AM Date Created
  • Views 795 views
  • Likes 0 likes
  • Comments 0 comments
  • android
  • riot_board
  • riotboard
  • leds
  • charlotte_godley
  • freescale_riot
Related
Recommended

Getting started with the RIoTboard: Hello, LED!

charlotte_godley
charlotte_godley
8 Oct 2014

A few weeks back I was given the RIoTboard to play with. This is another single board computer with some fun stuff on it - Ethernet, USB, Camera interface, GPIO expansion including I2C, 2 onboard LEDs...yadayadayada.

 

The operating system initially on the device from the factory is Android: this causes some concerns with how accessible the GPIO is from Java since it's not commonplace for Java to be low level as well as high level, but as there are few completed tutorials for how to write an app which gets to that low level, I decided to stick with this operating system rather than shifting to Linux.

 

Before following these steps to get going, you're going to want to set up your IDE (I used a mix of Eclipse and Android Studio: Android studio has less tutorials and is currently Beta, but Eclipse crashes...a lot) for which Sagar has written a tutorial, and root your operating system.

 

In order to test all this is working and light one of the onboard LEDs without making an app, we can enter this command into either the terminal emulator on the system, or from Putty or similar serial terminal using the serial debug - the debug interface is right up by the ethernet port:

image

the command:

su echo 1 > /sys/class/leds/user_led/brightness

 

Which should turn on the LED next to the power socket. To turn it off:

su echo 0 > /sys/class/leds/user_led/brightness

 

Now we'll go back to our app. Open up either eclipse or Android studio, create a new project & blank activity, then inside the OnCreate method add this line:

Process process = Runtime.getRuntime().exec("su -C echo 1 > /sys/class/leds/user_led/brightness");

 

Now when we come to run this on the RIoTboard, 2 things should happen:

- A pop up window will ask whether you want to grant root permissions

- After granting them, the LED closest to the power input should turn on.

 

The next phase of this project will be integrating Gmail with the app, so that we can create a notification light when a new unread email comes in.

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube