mechanic 0 Posted December 17, 2014 Share Posted December 17, 2014 Extending the Beaglebone Black network JavaScript usefulness.Mozilla, and its sister Iceweasel, have a web developer tool called Scratchpad.Scratchpad is available under the Tools/Web Developer menu on these browsers.What Scratchpad will allow is to write Bonescript programs on your main system and then run them on the Beaglebone just as if you modified the examples on the web page that the Beaglebone serves to your network connection. You can also save and edit your programs with Scratchpad.For example;Start the Beaglebone and connect to its web page.Click on the RUN button on top of the example Bonescript.All four LEDs should lite for 2 seconds.Now highlight the Bonescript code using the Right mouse button and then copy it using either CTRL+c or the copy function in Mozilla's Edit menu.Go to the Tools menu on Mozilla and select Web Developer -> Scratchpad.Then either use CTRL+v or the paste function in Scratchpads Edit menu to copy the code into Scratchpad.Clicking the RUN button in Scratchpad will now execute the code on the Beaglebone.NOTE* The Mozilla browser on your computer must be pointing to the Beaglebone in order for this to work. If you have a different tab open and active the server for that tab will not understand what you are doing.Save the program in Scratchpad somewhere on you computer with a suitable name like usrled.js .Playtime;In the Scratchpad window highlight the line "b.digitalWrite('USR3', b.HIGH);" and click RUN. Only one LED should light and stay lit.Edit the same line and change the "HIGH" to "LOW" and again highlight that line and run it. The LED should go off.If you now click RUN without selecting a line, only three LEDs should lite for 2 seconds.Have Fun. Automate 1 Quote Link to post Share on other sites
yyrkoon 250 Posted May 7, 2015 Share Posted May 7, 2015 I wonder how useful this would be for a stock Nodejs server on the BBB. I have not really looked too deep into Jasons code but I'd imagine he has some sym links, or binaries that do all the heavy lifting on the backend. Personally, I have no use for Bonescript, as I'd rather use my own abstraction layer, but I was unaware of of scratchpad ( I'm not really a web dev ), but know javascript "fairly" well. Pretty cool thanks for the info Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.