Skip to content
Snippets Groups Projects
sensori.txt 979 B
Newer Older
  • Learn to ignore specific revisions
  • Alfredo Chissotti's avatar
    Alfredo Chissotti committed
    A0 = sensore di luce
    A1 = sensore di temperatura
    A2 = sensore di suono
    
    
    Alfredo Chissotti's avatar
    Alfredo Chissotti committed
    0 h22:08, buio e con schermi accesi
    consigliato da internet:
    if (analogValue < 10) {
        Serial.println(" - Dark");
    } else if (analogValue < 200) {
        Serial.println(" - Dim");
    } else if (analogValue < 500) {
        Serial.println(" - Light");
    } else if (analogValue < 800) {
        Serial.println(" - Bright");
    } else {
        Serial.println(" - Very bright");
    }
    Una volta accesa la luce, 64/65
    
    Alfredo Chissotti's avatar
    Alfredo Chissotti committed
    Sparandogli il flash in faccia: 413 - 422
    
    Alfredo Chissotti's avatar
    Alfredo Chissotti committed
    
    
        A1:
    //https://wiki.seeedstudio.com/Grove-Temperature_Sensor_V1.2/
    int a = analogRead(pinTempSensor);
     
    float R = 1023.0/a-1.0;
    R = R0*R;
    
    Alfredo Chissotti's avatar
    Alfredo Chissotti committed
    
    
    float temperature = 1.0/(log(R/R0)/B+1/298.15)-273.15; // convert to temperature via datasheet
    
    Serial.print("temperature = ");
    Serial.println(temperature);
    
        A2:
    
    Alfredo Chissotti's avatar
    Alfredo Chissotti committed
    totale silenzio: 224 - 241
    
    Alfredo Chissotti's avatar
    Alfredo Chissotti committed
    rumore di sottofondo: 264 - 280
    musica vicina volume basso/medio: 276 - 289
    
    persona che parla a volume normale: 192 - 220; 331 - 395