/* Light Curves for Exoplanet search demo sketch * * This sketch calculates the brightness vs time coming * from a light bulb representing a star and a spherical object * representing a planet orbiting around the bulb. * When the planet is transiting directly in front of the star * there are dips in brightness.(The light sensor is * in the plane of the planet). * * This draft sketch was written during The Physics with Arduino School Arduino Physics School * organized by Sapienza University, Rome (Prof. G. Organtini). * * Components * ---------- * - Arduino Uno * - light sensor * */ long int t0; void setup() { Serial.begin(9600); t0=millis(); } void loop() { long int tempom = millis(); float media = 0.; // faccio la media su 100 misure di luminosità for (int i = 0; i < 1000; i++) { media += analogRead(A1); } media /= 1000.; float tempo=(tempom+millis())/2/1000.; //valore centrale intervallo temporale Serial.print(tempo); Serial.print(" "); Serial.println(media); //delay(250); if(tempom>t0+12000){ while (1){ } } }