For a project (check out my blog
for updates) I'm working on I needed to be able to communicate with my arduino, luckily the arduino can communicate though serial. It turns out almost any programming language can be used for serial communication but python seems to be the easiest so far.
I had some problems getting it all to work and finding a basic tutorial online proved very difficult. So hopefully this guide will explain the basics to anyone that is looking to start using the serial functions that the arduino provides.
I'm going to assume that if you're reading this you have some knowledge of how an arduino works and how to upload sketches and what not, however I will explain the arduino code when we get there. The python code is very basic but I will do my best to explain it as well.
The code is not that hard to understand, the hard part is understanding how the serial communication works.
So, I'm going to show you how to tell your arduino to blink using your computer. Once you understand this you should be able to expand both the python code and the arduino code to fit your own projects.