Saturday, January 22, 2011

Another possibility for Coding Purposes

There is another development platform known as "Arduino" :-
"Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It's intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments." quoted from the homepage...




This development platform is fully supported by our boards, has a good community support, very simple and precise syntax, inbuilt functions for majority of operations, awesome library support, support on all types of operating systems.
This platform functions on the basis of Pin Numbers and not Ports, and thus reduces the syntax quite considerably.

This platform has an IDE for its own, whose installations instructions can be found here. The latest version of IDE is 0022, which is still alpha for windows but is quite stable on linux.
The IDE is only about 3.5MB for linux, whereas it is about 180MB in windows as the developers provide all the packages consisting of all the pre-requisites as well.
Though i haven't tried the IDE on windows, because of the same reasons Arjun explained in his post, for linux, there are a few pre-requisites, namely being pre-installed JVM, gcc-avr, avr-libc and avrdude, installation is done by :-

sudo apt-get install gcc-avr avr-libc avrdude arduino arduino-core

I am assuming that JVM is already installed and all repositories are pre-selected. For more help, one may refer here.

The IDE is only about 3.5MB for linux, whereas it is about 180MB in windows as the developers provide all the packages consisting of all the pre-requisites as well.

Numerous examples are already available, which are accessible from the IDE itself and burning the code onto the board is also very simple(just click of a button) once the IDE has been correctly configured

Arduino version of the practical done on Thursday's lab session is as follows :-

"void setup() {
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(13, OUTPUT);
}

void loop() {
digitalWrite(13, HIGH); // set the LED on
delay(1000); // wait for a second
digitalWrite(13, LOW); // set the LED off
delay(1000); // wait for a second
} "

Yes, thats it !!! No need of including headers and other stuff, just write this on the IDE, compile/verify the code and upload onto the board.

1 comment:

  1. Thanks for posting this out. Briefly, this post and the post before describe two different programming environments for your boards - Arduino (in this post) and C (in the previous board). Arduino takes care of a lot of stuff in the background. You can chose any of the programming languages and any supporting IDE. However, Arduino gets a bit constrained when doing complex programming where C comes in handy. Also, programming in C will give you an exposure of exact stuff that happens in hardware which is to be taken care of by you. On the flip side, there is a bit steeper learning curve with C but much easier to get started with Arduino. As some people say - Arduino is for hobbyists while C programming is for programmers :). You pick. I do not mind any of the two as long as your deliverable is what is asked from you.

    ReplyDelete