Sparki Controller and Programming Environment


The Why of JSparks

Core Tenets

Tradition is Flawed

Learning to write software, like learning anything, should be fun, exciting, and accessible to a wide range of students. At present, that's often not the case. Commonly, educators select unexciting problems for their students to learn from:

Print out asterisks to form a diamond in the console
Ask the user for the prices and quantities of merchandise and print the total
And so on. Although these do teach the fundamentals, they're nothing short of boring and the students have the right to ask "who would really write a program to do this?"

The problem is that many core concepts have to be taught before you can teach the advanced concepts, and often many of those core concepts are language-specific such as the syntax of the language. Syntax errors cause outright failures in programming, which can be incredibly frustrating as a new student. It's a bit akin to misspelling something on a 2-page literature paper and getting a 0 as a result. If that were the case, only the most meticulous students would ever learn to write. But alas computers enforce syntax requirements and there's little to get around that.

Enter Sparki and JSparks

Sparki is a fantastic robot that brings the excitement of robotics to an accessibly low-cost platform. No more boring problems: as an educator, you can give your students problems of making a robot move around and do things for you! It's built on the open-source Arduino platform, has a ton of sensors and motors, and comes with a Bluetooth module to connect wirelessly. Being based on Arduino, it needs to be programmed and any updates to the code need to be done using the Arduino developer... until JSparks.

What is It?

JSparks is a system of:

  1. An out-of-the-box Arduino Sketch that has the Sparki's controls and a Bluetooth protocol built in
  2. A visual IDE based upon Blockly, which generates high-level, syntactically perfect code in JavaScript
  3. An Android application that interprets the JavaScript and provides live feedback to the developer as Sparki executes the commands

Each of these is steps designed specifically to reduce the amount of time dealing with syntax errors, writing complicated code for things like memory manipulation, type conversion, and debugging: all of which plague new developers. Not to discredit them: there are several other visual programming systems such as the Minibloq code which is showcased on the ArcBotics website. However, having personal experience with students plugging and unplugging robots from programmers, as well as other handling, I know that this is one of the more common ways in which things get broken. Additionally, I wanted to make sure that you could use the full functions of a high-level programming language like JavaScript.

No Frustration

JSparks allows students to drag and drop blocks that represent code around on an HTML page to create a program. It feels a bit like playing with Legos to build code. Behind the scenes, it builds perfect JavaScript and upon the click of a button, can show you the resultant code, run a simulation of what the code would do, and/or push the JavaScript to your Android-enabled device for real-world feedback. It prevents users from plugging together blocks which are incompatible by type, such as using a string input for something that should be an integer. This teaches students the fundamentals of software design without having to learn language-specific syntax or deal with some of the headaches of Arduino / C programming such as memory allocation, referencing/dereferencing, space restrictions of the Arduino, etc.

Rapid Learning

Because there's already an Arduino sketch to interpret the commands, there's no need to recompile code before execution. Simply push it to your mobile device, connect via Bluetooth, and hit the "Run" button. At every stage along the route to execution, JSparks provides visual feedback to help the student understand what's happening and why, down to the LCD showing the last executed command and what parameters were sent. The resulting, automatically-generated code is sensible and can be used to teach syntax... even though the act of programming just looks and feels like dragging blocks around. It comes out like this:

var ultrasonicDistanceInMeters;
ultrasonicDistanceInMeters = (Sparki.readDistance()) / 100;
if (ultrasonicDistanceInMeters < 2) {
Even though it looks and feels like this:

Plug Free

Hands-on electronics can be great, but they can also be the way that things get broken. Plugging Sparki in for programming leaves a lot of inquisitive hands very near sensitive electronics, making them more prone to breakage. Reprogramming Sparki also takes time out of the development cycle and requires you be at a workstation with the Arduino / SparkiDuino software installed. By using a web-based interface, your browser is your software development environment, which means you can program from anywhere, with virtually any web-enabled device.

Heard Enough?

Get started using JSparks now.