Advertisement
silver2row

LED stuff

Mar 30th, 2020
370
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // from BBB.io and some book, "Programming the BeagleBone Black."
  2.  
  3. const b = require('bonescript');
  4.  
  5. const bulb = "P9_30";
  6. b.pinMode(bulb, b.OUTPUT);
  7.  
  8. var state = 0;
  9.  
  10. function toggleBulb() {
  11.     state = state ^ 1;
  12.     b.digitalWrite(bulb, state);
  13. }
  14.  
  15. setInterval(toggleBulb, 5000);
  16. console.log("Blinking on and off on the BBGW!");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement