O'Reilly logo

Programming the BeagleBone by Yogesh Chavan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Program to turn onboard LED ON and OFF

We have collected enough information to program an onboard LED. BeagleBone comes with four small onboard user LEDs. They are located above the mini USB port. They are labeled as USER LEDs and named USER0, USER1, USER2, and USER3 LEDs. You can refer to the following image. We will turn on USER3 LED, which is configured by default to turn on each time the emmc is accessed:

Program to turn onboard LED ON and OFF

Create a new file in Cloud9 as we did in the previous chapter. Write the following code in it and save it as turnOnUSER3.js. Run the program and you should see USER3 LED turned on. The code for turnOnUSER3.js is as follows:

var b = require('bonescript'); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required