Skip to content
Snippets Groups Projects
Verified Commit 5760fde8 authored by Andrea Trentini's avatar Andrea Trentini
Browse files

fanloop tuning

parent af277c34
Branches
No related merge requests found
......@@ -7,6 +7,8 @@
volatile long timestamp=0;
volatile long durata=0;
volatile boolean updated=false;
float duty=.5; // %
int periodpwm=1000; //millis
//boolean fai=true; // per il "monitor"
......@@ -27,15 +29,17 @@ void loop() {
if(updated) {
//Serial.print(timestamp);
//Serial.print(F(","));
Serial.println(durata);
Serial.print(durata);
Serial.print(F(","));
Serial.println(duty*100);
//Serial.print(",");
//Serial.println(scattato);
updated=false;
}
// a questo punto posso permettermi tranquillamente di "dormire" anche a lungo... o no?
delay(500);
delay(periodpwm*(1.0-duty));
digitalWrite(ATTUATORE,HIGH);
delay(500);
delay(periodpwm*(duty));
digitalWrite(ATTUATORE,LOW);
/* versione "grande"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment