javascript - BeagleBone Black - Bonescript Syntax Error -
i having issues running scripts using bonescript on beaglebone black. when run scripts in web browser, executes normal. however, when try executing them terminal window, won't run.
#!/bin/bash var b = require('bonescript'); var leds = ["usr0", "usr1", "usr2", "usr3", "p9_14"]; for(var in leds) { b.pinmode(leds[i], b.output); } var state = b.low; for(var in leds) { b.digitalwrite(leds[i], state); } setinterval(toggle, 1000); function toggle() { state = (state == b.low) ? b.high : b.low; for(var in leds) { b.digitalwrite(leds[i], state); } } debian@beaglebone:~$ ./blinkled.js ./blinkled.js: line 2: syntax error near unexpected token `(' ./blinkled.js: line 2: `var b = require('bonescript');'
Comments
Post a Comment