Ready to try something different with your Arduino? You needn’t be confined by programming in C. Take these alternative languages for a test drive.
The Arduino IDE is core to the ethos behind the project — it’s a UI that attempts to turn the daunting task of learning a programming language into something that anyone can take a stab at. That’s certainly a noble cause, but there might well come a time when the IDE acts as a limit on your creativity.
Just as there are an enormous range of different coding languages, there are a multitude of different reasons that you might want to take a different approach to programming . One language might simply make more logical sense to you, while another user might thrive under an entirely different structure.
The important thing is to find a language that speaks to you and the goals that you’re looking to achieve.
Arduino is built around a straightforward programming language that’s meant to be welcoming to newcomers — but if you’re really short on experience, it might be worth trying a tool like ArduBlock. Rather than typing out your code, you’ll be able to construct your program visually using the same selection of functions as you would normally.
It’s great for younger users , but don’t think that this is ‘Arduino for Kids’. Some people just have a brain that works better with visual stimuli — and while ArduBlock is far from aesthetically pleasing in terms of its UI, it does present a very logical way of writing code for visual learners. At the same time, you’re still becoming familiar with the function names and variables you’ll need to use if you decide to move on to the full Arduino IDE.
ArduBlock is a downloadable tool that runs as an overlay to the official Arduino IDE. The final product won’t be any different to a program built using the normal process, so it’s a great first step if you’re just getting started. For anyone who’s not quite ready to learn a programming language outright, this is an excellent way to learn key concepts without getting caught up in the technicalities of coding.
Based on the drag-and-drop visual programming language developed at Berkeley, Snap4Arduino offers a slightly different experience to that of ArduBlock. The method of building your sketches remains much the same in a visual designer, but it’s clear that this software is intended for a slightly older audience.
With a more understated UI and less of a focus on bells and whistles, Snap4Arduino is resolutely non-patronizing. There’s no sense that this is an easier method of programming — it’s just different to the norm. While it’s being offered as a beta and its developers admit that there are still plenty of bugs, it’s very usable.
One trick to installing Snap4Arduino is the fact that it requires StandardFirmata to be installed on your Arduino. If you already have the Arduino IDE installed on your computer, that’s easy to sort out — simply open it up and navigate to Files > Examples > Firmata > StandardFirmata. Upload that to your board, and you’ll be able to interact with it from inside Snap4Arduino. Note that you can’t compile programs made in Snap, merely interact with the Arduino while it’s connected to your computer.
Serial communications allow for a handy, flexible way for your Arduino to communicate with your computer — you’ll likely have dabbled with the functionality in your early experiments with the device. With the help of a library like CmdMessenger, you’ll be able to go beyond using serial to merely inspect your Arduino sketch, and begin using it to code in a completely different language.
You can run CmdMessenger in either Microsoft’s Visual Studio or an equivalent third-party alternative. From there, you can communicate back and forth between your PC and the Arduino using C#, so you’re able to do things like call functions and send and receive commands.
Another way to program with C# is to use a purpose-built offshoot of the device like the Netduino . Since it’s built upon the .NET Micro Framework, the Netduino runs C# natively, straight out of the box. Although the pin layout is compatible with Arduino shields, it’s a completely different microcontroller and as such it isn’t an option if you’re looking to program with C# on an Arduino you already own.
While your Arduino can’t run code written in Python out of the box, it is possible to use Python to communicate with the device via serial input. This is very simple on a Unix-like system, but if you’re using a PC or a Mac then pySerial can bridge the gap. You can download pySerial from its developers website, which also features a host of information about running the software on various different operating systems — make sure that you have a copy of Python on your system, too.
You can find more information on reading and writing data to Arduino via pySerial at the Arduino Playground, but be warned that this is a fairly advanced technique. If you’re already well-versed in Python, then you’ll likely have a good handle on how to get it up and running — but if you’re relatively new to either the language or Arduino, there are gentler ways to get started than this.
That being said, Python is a very good fit for use in conjunction with Arduino. It’s a coding language designed to be intuitive, and as such is often recommended as a stepping stone to other forms of coding.What’s more, if you ever happen to branch out from Arduino to the similar Raspberry Pi, you’ll find that your Python experience will come in very handy.
Have you had success using other programming languages or IDEs with your Arduino? Let us know about it in the comments section below.
Image Credits: programming code Via Shutterstock