code du prototype 2 avec la photoresistance

const int sensorPin = 0; //The number of the pin Which is used to measure Vout

int lightLevel, concentration; //Which represent the Vout measure

void setup() //This function is called only at the moment the program is lauched
{
Serial.begin(9600); //A function to initiate the Serial function which
                    //serves to use the serial monitor to display the
                    //Vout values measured with the Voltage divider on
                    //the computer.

Serial.println("Start of the measurements"); //A first sentence to note
                                             //where the measurements begin
}

void loop() //This function will be called as long as the program works
{
lightLevel = analogRead(sensorPin); //AnalogRead is a function which
                                    //simply calculate the Vout value
                                    //which can be between 0[V] and 5
                                    //[V] and convert it to a number
                                    //between 0 (for 0[V]) and 1023
                                    //(for 5[V])

concentration = ( lightLevel – constant ) / slope;	//constant and slope were
							//both found with the 										//calibration

Serial.println(concentration); //Display the Vout value on the
                            //serial monitor of the computer

delay(1000); //Wait 1000 [ms] (= 1[s])
}