you need to do to set up a project is give it a name and
select your hardware. We selected the Arduino Uno.
The Blynk interface itself evokes The Grid from “Tron,”
with its dark background and neon lines. Creating control
interfaces with Blynk is as easy as dragging and dropping
widgets onto your screen because that is literally what you
do. The widgets can take many forms: buttons, sliders, and
even a two-axis joystick. You can place display widgets too
— everything from simple value displays to gauges.
Once you place a widget, you can click on it to open it
up. In the ensuing screen, you can name your widget
(something as blandly descriptive as “Servo 1” or as colorful
as “Deathclaw;” whatever floats your decimal point), select
which pin the device is on, and set a few other parameters
that might include the range of your slider (which we set to
180 to account for the limited range of the servo). You can
even change the color of the widget.
To start with baby steps, we crafted the simplest
controller possible: a humble button. Now, we had to
program the Uno. Blynk comes with its own host of
Arduino libraries which are freely downloadable from
GitHub (linked to from the Blynk website). To make
downloading as painless as possible, everything is included
in one folder, but that means importation into Arduino
needs to be done manually.
Fortunately, both the SparkFun and Blynk websites have
step-by-step tutorials on how to do just that. All it entails is
navigating to the correct folder on your computer (the
Arduino “libraries” folder) and copying the various Blynk
folders into it. You’ll need to restart the Arduino IDE
(integrated development environment) after feeding it new
libraries, but once you do there will be a plethora of Blynk
sketches under the Examples tab.
The sketch we were interested in was a demo under
the Boards and Shields category specifically for use with the
SparkFun Wi-Fi shield. The example code is well commented
and surprisingly short. The code requires only a few
modifications. Just like with the first demo we used, we
had to enter in our Wi-Fi SSID and password. You also need
to fill in the Blynk authorization token, and this is where
copying and pasting out of your email comes in handy.
There’s only one more step, but it’s an important one.
The example code has lines for both the software serial
setup and the hardware serial setup. By default, the
software serial lines are commented out and the hardware
ones are used. We swapped that, and the last detail was to
ensure that the RX and TX pins were properly identified in
58 SERVO 08.2016
INTERNET OF CLAWS.
THE SPARKFUN PWM SHIELD.
STACK ATTACK.