Sunday, May 16, 2010

Task 54 - Data logging

int photocellPin = 0; // the cell and 10K pulldown are connected to a0
int photocellReading; // the analog reading from the analog resistor divider

void setup() {
Serial.begin(9600);


for (int i=0; i <10; i++){
photocellReading = analogRead(photocellPin);
Serial.print("Analog reading = ");
Serial.println(photocellReading);
delay(500);
}
}

void loop(){
}

No comments:

Post a Comment