I try to keep going
const int sensorPin1 = A0;
const int sensorPin2 = A1;
const int sensorPin3 = A2;
const int ledPin1 = 11;
const int ledPin2 = 2;
const int ledPin3 = 3;
const int ledPinMain = 4;
int sensorValue = 0; // the sensor value
int sensorMin = 1023; // minimum sensor value
int sensorMax = 0;
void setup() {
// turn on LED to signal the start of the calibration period:
pinMode(11, OUTPUT);
digitalWrite(11, HIGH);
pinMode(2, OUTPUT);
digitalWrite(2, HIGH);
pinMode(3, OUTPUT);
digitalWrite(3, HIGH);
// calibrate during the first five seconds // this part i did not understand
while (millis() < 5000) {
sensorValue = analogRead(sensorPin1);
sensorValue = analogRead(sensorPin2);
sensorValue = analogRead(sensorPin3);
// record the maximum sensor value
if (sensorValue > sensorMax) {
sensorMax = sensorValue;
}
// record the minimum sensor value
if (sensorValue < sensorMin) {
sensorMin = sensorValue;
}
}
// signal the end of the calibration period
digitalWrite(11, LOW);
digitalWrite(2, LOW);
digitalWrite(3, LOW);
is it good so far?