IOT: TouchDevelop Generates Arduino Code

For IOT, having a nice design tool chain is a great benefit.  Sure you can crank out C/C++ Wiring code for the Arduino.  So can TouchDevelop, and this means that you could start your coding on your Phone, Tablet, iPad like device or Surface RT.  I like this as it is a way to use TouchDevelop without the game design motivation.  And I know that Spark.IO as well as others have generated an app that allows you to program in the cloud.  TouchDevelop is another way that allows students, hobbyists as well as others another way to create programs.  Software is capable of extreme diversity if we allow designers to solve problems and share them easily with others.

Let’s take a look at getting started, you will need a few items that cost nothing!  But are quite valuable. (As with all of my blogs, please make sure to scroll down to see the entire thing.)  The images are valid on 12/18/2014.  This is the images on a Windows 8.1 Lenovo, if you are using a Chromebook, iPad, etc. you may see slightly different screens.

To start, select “Choose Skill” (You may need to use settings to be in Beta mode)

image

Next Select Your Skill Level, in this case select “Curly”

image

Now select “Create Script”
image
Scroll down the template list till you see “Blank Ardunio
image
Scroll down till you see “blank Arduino”
image

You can change the Sketch name, an automatic name is generated.  You can change it later as well.

image
This is the design area, and is sometimes referred to as an Integrated Design Environment or IDE.  Visual Studio or Eclipse are examples of other IDEs.  For some designers, are not useful, for many people though, these kinds of tools are useful.  If you like writing or “scripting” code, then TouchDevelop may not be for you.  I like to do both, but find an IDE can much more efficient.  You may or may not agree with that.
image
Ok, if you are reading this, you might still not like TouchDevelop and feel scripting or other IDEs are more efficient, good.  But TD can be used for many types of work.  For example it might work with Arduinos or Arduino like devices.

image

On 12/18/2014 the TouchDevelop share looks like the following.  This may change on a later data.  Since this is beta, I select email, clipboard is not an easy thing for TouchDevelop. valid on 12/18/2014
image
If you select email, the following email opens.  You will need to have python 2.6 or 2.7, as well as Node.js on your system.  You do not need to open Node.js command prompt as an administrator, in fact don’t. valid on 12/18/2014
image
Using the Arduino IDE, upload a blank sketch, just so you know the exact state of your Arduino UNO, the “Pin 13” Connected LED on the board should not be blinking. (I like this UNO version, which you can get for around $21 with shipping.)
image
If you have Python AND Node.js installed, then you will get a verbose output in the command screen.  Which you may like, I usually like a verbose output from time to time, but really, just tell me if it worked or not.  If not, then I need the verbose output.  Really. (Double click to enlarge.)
image
Now your Arduino will blink, and you have used TouchDevelop to build the app.