]> git.piffa.net Git - sketchbook_andrea/blobdiff - oggi/photo_5_calibration/photo_5_calibration.ino
Merge branch 'master' of kim:/home/git/sketchbook_andrea
[sketchbook_andrea] / oggi / photo_5_calibration / photo_5_calibration.ino
index ede9ca8fda53acb52457ae3982e91cefe6931980..1d9b4d75f35f6d607f1aebbff02156aa201851e9 100644 (file)
@@ -39,10 +39,8 @@ int sensorMax = 0;           // maximum sensor value
 void setup() {
   // turn on LED to signal the start of the calibration period:
   pinMode(13, OUTPUT);
-  pinMode(9, OUTPUT);
   digitalWrite(13, HIGH);
 
-
   // calibrate during the first five seconds 
   while (millis() < 5000) {
     sensorValue = analogRead(sensorPin);
@@ -68,7 +66,7 @@ void loop() {
   sensorValue = analogRead(sensorPin);
 
   // apply the calibration to the sensor reading
-  sensorValue = map(sensorValue, sensorMin, sensorMax, 0, 254);
+  sensorValue = map(sensorValue, sensorMin, sensorMax, 0, 255);
 
   // in case the sensor value is outside the range seen during calibration
   sensorValue = constrain(sensorValue, 0, 255);