This document has been moved to AllThingsTalk Learning Centre.
After following this guide, you’ll be able to control your Arduino MKR WiFi 1010’s built-in RGB LED from your AllThingsTalk Maker using a color picker wheel.
The Arduino Integrated Development Environment (IDE) is an open source, cross-platform application that’s used for programming Arduino boards! It runs on Windows, Mac OS X, and Linux.
Some boards (such as MKR1010) require board “cores” to be installed inside the Arduino IDE. This enables Arduino IDE to program the board. It’s a simple step, so let’s get on with it!
You’ll need a few libraries that the example sketch relies on, so let’s install them:
Now you’ll need to create a pinboard, which will enable you to use a color picker to control your Arduino MKR WiFi’s RGB LED!
Done! You’ll use this color picker to control the Arduino MKR WiFi 1010’s RGB LED once you’re done with the steps below.
You can now program your Arduino MKR WiFi 1010 board using the sketch (program) below.
To do this, click download below and open it in Arduino IDE, or just copy/paste the code into your Arduino IDE:
#include <AllThingsTalk_WiFi.h> // Where the magic happens
Configure your WiFi and AllThingsTalk credentials by changing these few things in the code:
Now you’re going to upload the sketch you just configured onto your Arduino board:
In the bottom part of the Arduino IDE, you should see a message “Compiling sketch” and it should start uploading it to your MKR WiFi 1010 right after that.
Once you see “Done Uploading.”, the code has been uploaded to your MKR WiFi 1010 and you’re all set!
You can now go to Tools > Serial Monitor to actually see what’s happening on your board. Make sure to set the baud rate of your Serial Monitor to 115200.
Now give your MKR WiFi 1010 a reset (by pressing the RST button in the middle of the board) after you open Serial Monitor so you could see what’s going on from the beginning:
If your Arduino MKR WiFi 1010 has connected to the internet and if you see the “Connected to AllThingsTalk!” in your Serial Monitor, you’re good to go!
You should see the small orange LED on your Arduino MKR WiFi 1010 start fading in/out (it’s a feature of our new SDK), which means it’s connecting to WiFi and AllThingsTalk.
Once it blinks quickly and goes off, it means you’re connected!
You’ve just successfully integrated your Arduino MKR WiFi 1010 board with the platform. And yes, it’s that easy!
Now, this is barely scratching the surface of what’s possible with our platform and the device in front of you.
Fun idea: You could use rules to set the RGB LED to turn red when you leave your door open for longer than 5 minutes!
So, if you’re curious, check our Arduino WiFi SDK and the examples that come with it!