Blogs
Structuring Arduino code
One of the most important things in programming is writing understandable and readable code. Despite the fact that usually when you deal with electronics you have to write the code in very low level language, Arduino syntax is very close to such high level programming languages as C and PHP. If you know any of these languages, I bet there will be no problems for you.
The basic way of structuring your Arduino code is writing a normal procedural code. If we recall the example arduino code from the previous post, it was something like this:
Controlling Arduino via USB using PHP
As stated before, I have rather good experience in PHP programming. I’ve done many different things using PHP, starting from simple web applications to huge social network applications with tens of thousands simultaneous online users. I’ve also done some PHP applications that are used as servers for other software and even some basic desktop applications. With all that in mind, today I wanted to play around with Arduino and PHP. This might sound sick, but if you’ve read the previous posts, then you already know that PHP is my language of choice.
Getting started with Arduino
Ok, let’s get started with Arduino. You’ve decided that you want to learn some electronics and don’t have any clue on where to start. I was exactly in the same situation a while ago. I had bought the “electronics for dummies” book, red some paragraphs of it about resistors and some other components, but I had no idea on how to connect them and make them do things I need. The arduino is exactly what a beginner needs - it has very simple programming language, it can be connected directly to your computer via USB cable.
