IFD:Interaktive Elektronik 2012/5. Meeting: Difference between revisions

From Medien Wiki
mNo edit summary
mNo edit summary
 
Line 23: Line 23:


Problems + Solutions - discussion in class.
Problems + Solutions - discussion in class.
Homework:
 
'''Homework:'''<br>
1. Get Arduino running with one or more sensors and write a small test sketch in processing (or a program in your favourite language) to receive the two values.
1. Get Arduino running with one or more sensors and write a small test sketch in processing (or a program in your favourite language) to receive the two values.


2. Build a sensor of conductive material and experiment with it. Find an application using it. Document your Experiments in drawings, videos, photos.
2. Build a sensor of conductive material and experiment with it. Find an application using it. Document your Experiments in drawings, videos, photos.

Latest revision as of 14:42, 16 May 2012

Potentiometer A0 Serial Steckplatine.png


Step 1: Read a sensor value or potentiometer value

run this to receive singles bytes of a sensor value. Receive the bytes using processing, puredata or other software.


int analogValue; 
 
void setup () {
  Serial.begin(9600);
}
 
void loop () {
  analogValue = analogRead(A0)/4;
  Serial.write((char)analogValue); // char is a byte
  delay(100);
}

Step 2: Read multiple sensor values

Problems + Solutions - discussion in class.

Homework:
1. Get Arduino running with one or more sensors and write a small test sketch in processing (or a program in your favourite language) to receive the two values.

2. Build a sensor of conductive material and experiment with it. Find an application using it. Document your Experiments in drawings, videos, photos.