back


Arduino Board

We will work with the Arduino Duemilanove board. Detailed informations about the board you can find here:


http://arduino.cc/en/Main/ArduinoBoardDuemilanove


The board has the following basic ports:



1) DIGITAL


These pins can be declared as digital inputs (e.g. switch) or outputs (e.g. LED on/off).

Code to declare a digital output in the setup() function:


pinMode(pinNummer,OUTPUT);


Code to change state of digital output pin (e.g. LED on/off):


digitalWrite(pinNummer,HIGH); // value is HIGH or LOW


To write an anlog value (PWM wave) to a digital pin the analogWrite() function is used. The board provides this function for the pins 5,6,9,10,11:


analogWrite(pinNumber,value); // value is between 0 and 255


2) POWER


1 x 5V

1 x GND


3) ANALOG IN:


The board has 6 input pins to measure voltage (0-5 Volt) by using an A/D Converter. Sensors should be connected to these pins.


Code to read a sensor value:


int sensorValue = analogRead(pinNumber); // value is between 0 and 1024


4) USB-Port


The board is programmed over the USB-port, which actually is a serial port. The board can also be powered over the USB-port (if you work with the SensorAktor Shield always use an external power supply!).