Home / Tutorials / BeagleBone Tutorial / Input to BeagleBone Black with BoneScript
beaglebone black adc

Input to BeagleBone Black with BoneScript

Using a Button

As you’ve noticed, the functions in bonescript are similar to Arduino’s. If we are to use an input device such as a button, switch, etc, we only need to change the direction using pinMode:


The script below reads the state of a button attached to P9_11. If that button is pressed, the LED at P9_12 will turn on. Otherwise, the LED remains off.

Beaglebone Black Button

Check Also

beaglebone black adc

Controlling a Servo Motor with BoneScript

Using the Beaglebone Black's PWM Bonescript also includes an analogWrite function which utilizes the 8 …