Touch Develop retirement postponed until June 22, 2019. Sign-in and access to cloud assets to be removed on May 23, 2018.Learn More..


getting started with arduino

overview

The goal of this project is to create and upload Arduino sketches using the TouchDevelop from any device and seamlessly upload them to the board.
You write TouchDevelop code as usual and we'll compile it to Arduino C++ for you.
function
loop
()
 arduino → digital write(13,  arduino → HIGH)
 arduino → delay(100)
 arduino → digital write(13,  arduino → LOW)
 arduino → delay(100)
end function
You can also package your Arduino code as TouchDevelop library and use in your script. Here is a snippet that turns off a NeoPixel strip using the arduino neopixels library.
function
loop
()
for 0 i <  strip → num pixels do
 strip → set pixel color rgb(i, 0, 0, 0)
end for
end function

machine setup

Windows + Chocolatey

Chocolatey.org is a package manager for Windows that makes it super easy to get started.
  • install Chocolatey
  • open an administrative command prompt
  • run the following command
choco install nodejs.install arduino python2 pip

Full steps

TouchDevelop setup

  • create a new empty folder that will hold your local TouchDevelop files. Do not run from system32!
  • install touchdevelop local by running this command (sudo might be required for bash)
npm install -g http://aka.ms/touchdevelop.tgz
  • launch touchdevelop local
touchdevelop
  • TouchDevelop will open from a http://local:4242/editor/beta... address, you will need to run from there in order to build arduino sketches. We'd recommend making a bookmark of that address.

getting started

  • Try one of the arduino tutorials to get you started.
  • From the hub, you can tap on create script then use the blank arduino.

exporting a script to Arduino

From the script editor, simply tap on the arduino upload button to start the build/upload process.

serial monitor

From the script editor, simply tap on the serial monitor to monitor the serial port messages from TouchDevelop.

libraries

Here is a non-exhaustive list of libraries for components: