Johnny-Five v1.0 – JavaScript Robotics and IoT Framework
johnny-five.io
johnny-five.io
The program runs on your computer and issues commands to the firmware via the link. This makes the board "tethered" to the PC so to speak.
That said, hooking up a Raspberry PI running node to an Arduino sort of alleviates the "tethered-ness" and I believe it is the lowest effort barrier to entry into robotics and presents endless creative opportunities.
Was playing with Johnny Five yesterday (while they were releasing 1.0, fun to watch), and was deploying my node project code to my Tessel 2, which then ran independently of my laptop.
I was amazed at how easy it was to go from 0 to deployed code running reliably on the (detached, untethered) dev board. At least when working with the Tessel 2, they really think through the dev experience end-to-end.
[Edit: Tessel, not Tessle]
I tried my hand at an MCK because I could do it from ActionScript, a language I was already comfortable with. Asking users to learn both about controlling hardware and a new programming language/model simultaneously steepens the barrier to entry versus decoupling those things.
For beefier linux boards, like Tessel and Beagle Board, it's what you've described: http://johnny-five.io/platform-support/#beaglebone-black http://johnny-five.io/platform-support/#tessel-2
Hence all the callbacks, promises, async/awaits patterns to learn in JavaScript..
That being said I have zero robotics experience, just a lot of JS experience lol :shrug:
The next line in JS is guaranteed to execute immediately after the preceding one; except in the case of callbacks (including sugar, like promises), which are also executed sequentially, but deferred until they are explicitly called by whatever they're passed to. In fact, one of the biggest complaints about JavaScript (that it can block the main thread if it tries to do too much in one frame) is a consequence of this guarantee.
Granted, I've written primarily JavaScript for the last five years, but it's pretty straightforward to reason about. Any language that lets you respond to events, I/O, etc. is going to require that you reason about things over time - JavaScript is no outlier here.
The way you've written your remark, it sounds as if JavaScript executes lines out of order, or will wait an arbitrary amount of time to move from one line to the next. Obviously, neither of those is true.
But as the top commenter mentions, still no standalone support on devices like Arduino, which is what prevented me from using it in my projects. (I don't know if it's possible to fit a node runtime onto something as small as an Arduino, anyways)
I wouldn’t have thought it at first, but JavaScript is turning out to be our most important language for driving IoT, and while I haven’t heard about Johnny-five before, it looks pretty good.
[1] http://www.moddable.com/ [2] https://github.com/Moddable-OpenSource/moddable
It seemed kind of trivial when I first heard about it, but now that I've experimented some with these things it's not that trivial, and it's a reasonable approach. Especially for robotics – an Arduino board isn't a good way to drive a robot (too limited), but it's a good way to drive many (but not all) of the specific components you might want to control. Then the real brain can be a Raspberry Pi or some other proper computer.
but why use this if Pi has support for sensors and stuff already? (other than, "because I've already bought Arduino")
The obvious solution is to create higher-level hardware that the Pi can control without, say, pulsing on a regular interval, or without having to provide the full power requirements via GPIO. An Arduino board is a modular way to do exactly that. The Arduino then becomes the "device".
Johnny-Five programs can run on board any SBC that runs Linux and can support Node.js. For those platforms, GPIO and serial bus interfaces are interacted with directly; examples include Raspberry Pi, Intel Edison (+Galileo 1 & 2, Joule), Tessel 2, Linino and pcDuino
:/