Toggle LED
In this section, let's do a quick and easy recipe with BoneScript, one that turns on and off the on board LEDs, also known as USR LEDs. We will tackle more complex recipes with BoneScript in the next chapter.
How to do it...
In order to do this, perform the following steps:
Remove all cables and power from your BBB.
Power up your board via the mini USB using your desktop USB port.
On the
BEAGLEBONE_BLACK
device that appears on your desktop, browse to and open theSTART.htm
file (some versions of the OS may have a slightly different file name, such asBASIC_START.htm
).Note
Note that on Debian 8 (Jessie), your board will be labelled
BEAGLEBONE
on the desktop and notBEAGLEBONE_BLACK
.Scroll down the page to
BoneScript interactive guide
, where you'll see an embedded script that you can run to interact with BBB.Click on Run.
All the LEDs should stay on for two seconds. Let them return to blinking.
Now change USR0 from
b.HIGH
tob.LOW
.Change the timing from
2000
to12000
.You should now see...