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:
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'); ...