Code examples for driving the WaterColorBot from within block-based programming languages like Scratch and Snap!
We are gearing up for "official release," working on checks, balances, bug fixes, additional examples, and documentation. Additional eyes are welcome now, as we head towards official release.
You can download the examples here (a zip file). To use these examples, you will need to also download and launch a helper app (see below) that manages communication with the WaterColorBot.
The Snap! interface and examples are tested and working under the new CNCserver REST-less API.
The Scratch interface and examples are tested and working under the new CNCserver REST-less API.
Please note that only the Scratch interface is somewhat simpler than the Snap! interface: The blocks in the interface move the WaterColorBot, but do not automatically move the sprite on the screen to match.
Pending full support for 3rd party extensions, you can enable WaterColorBlocks in the Scratch online editor using the following code as the URL in a bookmark to make a bookmarklet:
javascript:(function(){var%20s=document.createElement('script');s.setAttribute('src','https://cdn.rawgit.com/techninja/cncserver/8a95b420519e09a6692177a8a4d5fa87fc26b54c/watercolorbot_scratch.js');document.body.appendChild(s);}());)
Once you have that saved, just click the bookmark while in the loader and the WaterColorBlocks will appear in the More Blocks section.
Using the WaterColorBot through WaterColorBlocks requires the use of a helper application that runs in the background operating the robot.
The WaterColorBot interface is built into RoboPaint (in versions 0.9.0b and higher). Download RoboPaint at https://github.com/evil-mad/robopaint/releases . When you launch RoboPaint, it should automatically connect to the WaterColorBot. All that you need to do is simply launch it, and leave it running in the background while you use Scratch or Snap!. It is recommended to leave RoboPaint on the Home screen (asking you to choose between Create/Print/Manual) while it is running.
If you cannot (or do not wish to) run RoboPaint for any reason, you can alternately run CNCserver in the background, to manage communication with the WaterColorBot. You can download the current version of CNCserver here: https://github.com/techninja/cncserver
Run CNCserver in background, launched with command:
node cncserver
It is worth noting that "under the hood," RoboPaint contains and runs a copy of CNCserver that it uses to communicate with the WaterColorBot.
Scratch is available at: http://scratch.mit.edu
Snap! is available at: http://snap.berkeley.edu
WaterColorBot is available at: http://watercolorbot.com
The Scratch API in CNCserver is documented here: https://github.com/techninja/cncserver/blob/master/scratch/SCRATCH.API.md