From e9b0b744f9163dac319022d1b2552f49fe1e6bc0 Mon Sep 17 00:00:00 2001
From: Andrea Manni <andrea@piffa.net>
Date: Fri, 10 Feb 2017 02:44:43 +0100
Subject: [PATCH] CLean up ssl

---
 README.html                                   |  24 +-
 README.rst                                    |  18 +-
 README.txt                                    |  27 +-
 aerei/cirso/cirso.ino                         |   6 +-
 .../ailerons_state_rgb/ailerons_state_rgb.ino |   2 +-
 esempi/base_th/base_th.ino                    |  28 +-
 .../calibrazione_servo/calibrazione_servo.ino |   6 +-
 esempi/state_throttle/state_throttle.ino      |   3 +-
 libraries/common/common.cpp                   |   2 +
 libraries/common/common.cpp_bak               | 414 ------------------
 .../common/examples/sequenza/sequenza.ino     |   2 +-
 libraries/common/keywords.txt                 |   1 +
 12 files changed, 78 insertions(+), 455 deletions(-)
 rename esempi/{ => snippets}/calibrazione_servo/calibrazione_servo.ino (82%)
 delete mode 100644 libraries/common/common.cpp_bak

diff --git a/README.html b/README.html
index e1fe268..81be294 100644
--- a/README.html
+++ b/README.html
@@ -387,15 +387,33 @@ git pull
 </pre>
 <dl class="docutils">
 <dt>Download manuale archivio:</dt>
-<dd><a class="reference external" href="http://git.andreamanni.com/web?p=aerei;a=snapshot;h=HEAD;sf=tgz">http://git.andreamanni.com/web?p=aerei;a=snapshot;h=HEAD;sf=tgz</a></dd>
+<dd><a class="reference external" href="https://git.andreamanni.com/web?p=aerei;a=snapshot;h=HEAD;sf=tgz">https://git.andreamanni.com/web?p=aerei;a=snapshot;h=HEAD;sf=tgz</a></dd>
 <dt>Browse on line:</dt>
-<dd><a class="reference external" href="http://aerei.piffa.net/repo/">http://aerei.piffa.net/repo/</a></dd>
+<dd><a class="reference external" href="https://aerei.piffa.net/repo/">https://aerei.piffa.net/repo/</a></dd>
 <dt>Interfaccia git Web:</dt>
-<dd><a class="reference external" href="http://git.andreamanni.com/web?p=aerei">http://git.andreamanni.com/web?p=aerei</a></dd>
+<dd><a class="reference external" href="https://git.andreamanni.com/web?p=aerei">https://git.andreamanni.com/web?p=aerei</a></dd>
 <dt>Discussioni:</dt>
 <dd><a class="reference external" href="https://forum.piffa.net/viewforum.php?f=4&amp;sid=aef380599d890d6e7b9f92743fab9d7e">https://forum.piffa.net/viewforum.php?f=4&amp;sid=aef380599d890d6e7b9f92743fab9d7e</a></dd>
 </dl>
 </div>
+<div class="section" id="links">
+<h1>Links</h1>
+<p>Risorse utili per utilizzare Arduino:</p>
+<ul class="simple">
+<li>Per poter programmare le schede Arduino: Arduino IDE: <a class="reference external" href="https://www.arduino.cc/en/Main">https://www.arduino.cc/en/Main</a>/Software#</li>
+<li><dl class="first docutils">
+<dt>Risorse di Andrea: <a class="reference external" href="https://lab.piffa.net/">https://lab.piffa.net/</a></dt>
+<dd><ul class="first last">
+<li>Wiki: <a class="reference external" href="http://wiki.piffa.net/">http://wiki.piffa.net/</a></li>
+<li>Forum: <a class="reference external" href="https://forum.piffa.net/">https://forum.piffa.net/</a></li>
+</ul>
+</dd>
+</dl>
+</li>
+<li>Testi consigliati: <a class="reference external" href="https://lab.piffa.net/testi.html">https://lab.piffa.net/testi.html</a></li>
+<li>Risorse online: <a class="reference external" href="http://wiki.piffa.net/index.php/Guide">http://wiki.piffa.net/index.php/Guide</a></li>
+</ul>
+</div>
 </div>
 </body>
 </html>
diff --git a/README.rst b/README.rst
index dcd8c23..0047404 100644
--- a/README.rst
+++ b/README.rst
@@ -27,14 +27,26 @@ Per aggiornare all'ultima versione::
     git pull
 
 Download manuale archivio:
-    http://git.andreamanni.com/web?p=aerei;a=snapshot;h=HEAD;sf=tgz    
+    https://git.andreamanni.com/web?p=aerei;a=snapshot;h=HEAD;sf=tgz    
 
 Browse on line:
-    http://aerei.piffa.net/repo/
+    https://aerei.piffa.net/repo/
 
 Interfaccia git Web:
-    http://git.andreamanni.com/web?p=aerei
+    https://git.andreamanni.com/web?p=aerei
 
 Discussioni:
     https://forum.piffa.net/viewforum.php?f=4&sid=aef380599d890d6e7b9f92743fab9d7e
     
+
+
+Links
+=========
+Risorse utili per utilizzare Arduino:
+
+* Per poter programmare le schede Arduino: Arduino IDE: https://www.arduino.cc/en/Main/Software#
+* Risorse di Andrea: https://lab.piffa.net/
+    * Wiki: http://wiki.piffa.net/
+    * Forum: https://forum.piffa.net/
+* Testi consigliati: https://lab.piffa.net/testi.html
+* Risorse online: http://wiki.piffa.net/index.php/Guide
diff --git a/README.txt b/README.txt
index 5451a4a..564ce41 100644
--- a/README.txt
+++ b/README.txt
@@ -18,26 +18,31 @@ Aggiornamenti
           git clone git://git.andreamanni.com/aerei
 
    Per aggiornare all'ultima versione:
-    cd ~/aerei
-    git pull
+        cd ~/aerei
+        git pull
 
    Download manuale archivio:
-          [1]http://git.andreamanni.com/web?p=aerei;a=snapshot;h=HEAD;sf=t
-          gz
+          [1]https://git.andreamanni.com/web?p=aerei;a=snapshot;h=HEAD;sf=
+          tgz
 
    Browse on line:
-          [2]http://aerei.piffa.net/repo/
+          [2]https://aerei.piffa.net/repo/
 
    Interfaccia git Web:
-          [3]http://git.andreamanni.com/web?p=aerei
+          [3]https://git.andreamanni.com/web?p=aerei
 
    Discussioni:
           [4]https://forum.piffa.net/viewforum.php?f=4&sid=aef380599d890d6
           e7b9f92743fab9d7e
 
-References
+Links
+
+   Risorse utili per utilizzare Arduino:
+     * Per poter programmare le schede Arduino: Arduino IDE:
+       [5]https://www.arduino.cc/en/Main/Software#
+     * Risorse di Andrea: [6]https://lab.piffa.net/
+       - Wiki: [7]http://wiki.piffa.net/
+       - Forum: [8]https://forum.piffa.net/
+     * Testi consigliati: [9]https://lab.piffa.net/testi.html
+     * Risorse online: [10]http://wiki.piffa.net/index.php/Guide
 
-   1. http://git.andreamanni.com/web?p=aerei;a=snapshot;h=HEAD;sf=tgz
-   2. http://aerei.piffa.net/repo/
-   3. http://git.andreamanni.com/web?p=aerei
-   4. https://forum.piffa.net/viewforum.php?f=4&sid=aef380599d890d6e7b9f92743fab9d7e
diff --git a/aerei/cirso/cirso.ino b/aerei/cirso/cirso.ino
index f9b1700..5e5c3d8 100644
--- a/aerei/cirso/cirso.ino
+++ b/aerei/cirso/cirso.ino
@@ -1,8 +1,8 @@
 /* Aereo di Cirso
 
    Esempio base:
-   2 LED ai lati lampeggio alternato
-   1 LED in coda lampeggio a freq doppi
+   2 LED ai lati con lampeggio alternato
+   1 LED in coda lampeggio a freq doppia
 */
 
 #include <common.h>
@@ -24,5 +24,5 @@ void setup() {
 void loop() {
   left.Blink();   // Lampeggia con un default di 1sec (0.5 HI 0.5 LOW)
   right.Blink();
-  coda.Blink(1000);
+  coda.Blink(1000); // Lampeggio in 1000ms = 1 secondo
 }
diff --git a/esempi/ailerons_state_rgb/ailerons_state_rgb.ino b/esempi/ailerons_state_rgb/ailerons_state_rgb.ino
index a147f0b..7eb4c25 100644
--- a/esempi/ailerons_state_rgb/ailerons_state_rgb.ino
+++ b/esempi/ailerons_state_rgb/ailerons_state_rgb.ino
@@ -63,7 +63,7 @@ void loop() {
         ailTimer = currentMillis ;
 
         ailIn = pulseIn(ailPin, HIGH, 25000);
-        if (ailIn != 0 && ailIn > 1000 && ailIn <2000)  {
+        if (ailIn != 0 && ailIn > 960 && ailIn <2000)  {
             // get only resonable values
             ail = ailIn;
         } ;
diff --git a/esempi/base_th/base_th.ino b/esempi/base_th/base_th.ino
index 430c94d..0bb90e6 100644
--- a/esempi/base_th/base_th.ino
+++ b/esempi/base_th/base_th.ino
@@ -20,24 +20,24 @@ byte thr ; // Throttle
 int thrIn ;
 
 void setup() {
-  // I PINs vengono impostati dal constructor al momento
-  // della dichiarazione dell'ogetto.
+    // I PINs vengono impostati dal constructor al momento
+    // della dichiarazione dell'ogetto.
 
-  right.Invert() ;  // Opzionale: inverte l'ordine del lampeggio da
-  // HI -> LOW --> LOW -> HI
-  // per avere 2 LED che lampeggiano alternativamente
+    right.Invert() ;  // Opzionale: inverte l'ordine del lampeggio da
+    // HI -> LOW --> LOW -> HI
+    // per avere 2 LED che lampeggiano alternativamente
 }
 
 void loop() {
 // Lettura CH3
-  thrIn = pulseIn(thrPin, HIGH, 25000);
-  thr = constrain(map(thrIn, 983, 2000, 0, 255), 0, 255) ;
-
-
+    thrIn = pulseIn(thrPin, HIGH, 25000);
+    if (thrIn != 0 && ailIn > 983 && ailIn < 2000)  { // clean up
+        thr = map(thrIn, 983, 2000, 0, 255); // mappato su 8bit per PWM
+    }
 
 // Attivazione LEDs
-  left.Blink(1120 - 4 * thr);   
-  right.Blink(1120 - 4 * thr);
-  sotto.lSet(thr);   // Luminosita' proporzionale al throttle
-  delay(10); // Opzionale 
-}
+        left.Blink(100 + thr);
+        right.Blink(100 + thr);
+        sotto.lSet(thr);   // Luminosita' proporzionale al throttle
+        delay(10); // Opzionale
+    }
diff --git a/esempi/calibrazione_servo/calibrazione_servo.ino b/esempi/snippets/calibrazione_servo/calibrazione_servo.ino
similarity index 82%
rename from esempi/calibrazione_servo/calibrazione_servo.ino
rename to esempi/snippets/calibrazione_servo/calibrazione_servo.ino
index 7e66708..fdea338 100644
--- a/esempi/calibrazione_servo/calibrazione_servo.ino
+++ b/esempi/snippets/calibrazione_servo/calibrazione_servo.ino
@@ -25,13 +25,11 @@ void setup() {
     Serial.begin(9600); // Se abilitato la calibrazione viene tracciata su seriale
     // Abilitando anche DEBUG nella libreria
 
-//    mid_point =  calibraTrim(ailPin) ; // Pin a cui e' collegato il canale
-mid_point =  calibraTrim(ailPin,11) ; // + LED di servizio per calibrazione
+    mid_point =  calibraTrim(ailPin) ; // Pin a cui e' collegato il canale
+//mid_point =  calibraTrim(ailPin,11) ; // + LED di servizio per calibrazione
 
 Serial.print("Valore calibrato: ");
 Serial.println(mid_point);
-
-    while(1); // Stoppa Arduino
 }
 
 void loop() {
diff --git a/esempi/state_throttle/state_throttle.ino b/esempi/state_throttle/state_throttle.ino
index 23e3a2d..7220876 100644
--- a/esempi/state_throttle/state_throttle.ino
+++ b/esempi/state_throttle/state_throttle.ino
@@ -39,7 +39,7 @@ void loop() {
 
  // Lettura Throttle channel
  thrIn = pulseIn(thrPin, HIGH, 25000);
- thr = constrain(map(thrIn, 983, 2000, 0, 255), 0, 255) ; // 983 potrebbe campbiare con 
+ thr = constrain(map(thrIn, 983, 2000, 0, 255), 0, 255) ; // 983 potrebbe cambiare 
            // con un altra ricevente, fare una calibrazione nel caso.
 
  // FMS dispatcher
@@ -75,4 +75,5 @@ void loop() {
      delay(random(20, 100));
      break;
   }
+  }
 
diff --git a/libraries/common/common.cpp b/libraries/common/common.cpp
index 7f05627..5a7230d 100644
--- a/libraries/common/common.cpp
+++ b/libraries/common/common.cpp
@@ -112,6 +112,8 @@ void RGBLed::Off () {
 /////////////////////////////////////
 // Lampeggiatore
 // Constructor
+//
+// Esempi incrementali: https://lab.piffa.net/sketchbook_andrea/multitasking/
 Lampeggiatore::Lampeggiatore(int pin)
 {
     ledPin = pin;
diff --git a/libraries/common/common.cpp_bak b/libraries/common/common.cpp_bak
deleted file mode 100644
index 9392335..0000000
--- a/libraries/common/common.cpp_bak
+++ /dev/null
@@ -1,414 +0,0 @@
-/*  Common
- *
- *  Oggetti di uso comune
- *  Autore: Andrea Manni
- *
- *  Link: http://git.andreamanni.com/
- *  Licenza:    GPLv3
- */
-
-#include "Arduino.h"
-#include "common.h"
-
-
-//////////////////////
-// RGB LED
-// Common anode / cat
-
-RGBLed::RGBLed(byte pinR, byte pinG, byte pinB) {
-    // Per un common catodo, valore max / min invertiti
-    redPin    = pinR ;
-    greenPin  = pinG ;
-    bluePin   = pinB ;
-    common    = 255 ;
-
-    // Equvalente del Setup() per inizializzare i PIN
-    pinMode(redPin, OUTPUT);
-    pinMode(greenPin, OUTPUT);
-    pinMode(greenPin, OUTPUT);
-};
-
-RGBLed::RGBLed(byte pinR, byte pinG, byte pinB, byte com) {
-    // Per un common anode, valore max / min normali
-    redPin    = pinR ;
-    greenPin  = pinG ;
-    bluePin   = pinB ;
-    common    = com ;
-
-    // Equvalente del Setup() per inizializzare i PIN
-    pinMode(redPin, OUTPUT);
-    pinMode(greenPin, OUTPUT);
-    pinMode(greenPin, OUTPUT);
-};
-
-void RGBLed::SetColor (byte r, byte g, byte b) {
-// Imposta il colore di un LED RGB
-    analogWrite(redPin,   common - r);
-    analogWrite(greenPin, common - g);
-    analogWrite(bluePin,  common - b);
-
-// Debug
-//   Serial.print(common - r);
-//   Serial.print("-");
-//   Serial.print(common - g);
-//   Serial.print("-");
-//   Serial.print(common - b);
-//   while(1);
-
-};
-
-void RGBLed::Rand () {
-// Imposta il colore di un LED RGB
-    analogWrite(redPin, random(0,256));
-    analogWrite(greenPin, random(0,256));
-    analogWrite(bluePin, random(0,256));
-};
-
-void RGBLed::Red () {
-// Accende il LED di rosso
-    SetColor(255,0,0);
-};
-
-void RGBLed::Green () {
-// Accende il LED di verde
-    SetColor(0,255,0);
-};
-
-void RGBLed::Blue () {
-// Accende il LED di blu
-    SetColor(0,0,255);
-};
-
-void RGBLed::Magenta () {
-// Accende il LED di magenta
-    SetColor(255,0,255);
-};
-
-void RGBLed::Cyano () {
-// Accende il LED di Cyano
-    SetColor(0,255,255);
-};
-
-void RGBLed::Yellow () {
-// Accende il LED di giallo
-    SetColor(255,255,0);
-};
-
-void RGBLed::White () {
-// Accende il LED
-    SetColor(255,255,255);
-};
-
-void RGBLed::Off () {
-// Spegne il LED
-    SetColor(0,0,0);
-};
-
-
-
-/////////////////////////////////////
-// Lampeggiatore
-// Constructor
-Lampeggiatore::Lampeggiatore(int pin)
-{
-    ledPin = pin;
-    pinMode(ledPin, OUTPUT);
-    ledState = LOW;
-    previousMillis = 0;
-    interval = 500;
-};
-
-// Una funzione facente parte di una classe prende il nome di "metodo" della stessa:
-void Lampeggiatore::Invert() {
-    // Inverte il lampeggio
-    ledState = HIGH ;
-}
-
-void Lampeggiatore::Blink() {
-    // Illumina il led a 500ms
-
-    if(millis() + shift - previousMillis > interval) {
-
-        // if the LED is off turn it on and vice-versa:
-        ledState = !ledState ; // Inverti il LED
-        // set the LED with the ledState of the variable:
-        digitalWrite(ledPin, ledState);
-        // save the last time you blinked the LED
-        previousMillis += interval;
-    }
-};
-
-void Lampeggiatore::Blink(long time, long drift ) {
-    // Illumina il led secondo un intervallo passato come argomento
-
-    shift = drift;
-    if(millis() + shift - previousMillis > time) {
-        // if the LED is off turn it on and vice-versa:
-        ledState = !ledState ; // Inverti il LED
-    // set the LED with the ledState of the variable:
-    digitalWrite(ledPin, ledState);
-        // save the last time you blinked the LED
-        previousMillis += time;
-    }
-};
-
-void Lampeggiatore::Blink(long up, long down, long drift ) {
-    // Illumina il ledB precisando ontime e downtime
-
-    shift = drift;
-    if((ledState == HIGH)&& (millis() + shift - previousMillis > up)) {
-        // save the last time you blinked the LED
-        previousMillis += up;
-        ledState = LOW  ;
-    }
-    else if((ledState == LOW)&& (millis() + shift - previousMillis > down)) {
-        previousMillis += down;
-        ledState = HIGH  ;
-    }
-
-    // set the LED with the ledState of the variable:
-    digitalWrite(ledPin, ledState);
-};
-
-void Lampeggiatore::High() {
-    // Accende il LED
-
-    digitalWrite(ledPin, HIGH);
-}
-
-void Lampeggiatore::Low() {
-    // Spegne  il LED
-
-    digitalWrite(ledPin, LOW);
-}
-
-void Lampeggiatore::Swap() {
-    // Inverte lo stato del LED
-
-    digitalWrite(ledPin, !digitalRead(ledPin));
-}
-
-/////////////////////////////////////
-// Pwm
-// Constructor
-Pwm::Pwm(int pin)
-// Gestione del PWM utilizzando millis
-// per non bloccare il processore con delay
-// Warning: serialWrite puo' interferire con i tempi.
-{
-    ledPin = pin;
-    pinMode(ledPin, OUTPUT);
-    previousMillis = 0;
-    byte brightness = 0 ;
-    increment = 1;
-};
-
-void Pwm::Up(long speed, long drift) {
-    // Aumenta linearmente la luminosita' usanndo millis()
-    // quindi senza bloccare il processore
-    // Viene usato un float, in alternativa un coseno
-
-    if (millis() != previousMillis)  { // si potrebbe togliere
-        shift = drift;
-        brightness = 255.0 /(float)speed * (millis() + shift);
-        analogWrite(ledPin, brightness);
-
-        previousMillis = millis();
-    };
-}
-
-void Pwm::lUp(long speed, long drift) {
-    // Aumenta usanndo millis() con correzione luminosita' LED
-    // quindi senza bloccare il processore
-    // Viene usato un float, in alternativa un coseno
-
-    if (millis() != previousMillis)  { // si potrebbe togliere
-        shift = drift;
-        brightness = 255.0 /(float)speed * (millis() + shift);
-        analogWrite(ledPin, lum(brightness));
-
-        previousMillis = millis();
-    };
-}
-
-void Pwm::Down(long speed, long drift) {
-    // Riduce linearmente la luminosita' usanndo millis()
-    // quindi senza bloccare il processore
-
-    if (millis() != previousMillis)  {
-        shift = drift;
-        brightness = 255 - 255.0 /(float)speed * (millis() + shift) ;
-        analogWrite(ledPin, brightness);
-
-        previousMillis = millis();
-    };
-}
-
-void Pwm::lDown(long speed, long drift) {
-    // Riduce  usanndo millis() con correzione della luminosita'
-    // quindi senza bloccare il processore
-
-    if (millis() != previousMillis)  {
-        shift = drift;
-        brightness = 255 - 255.0 /(float)speed * (millis() + shift) ;
-        analogWrite(ledPin, lum(brightness));
-
-        previousMillis = millis();
-    };
-}
-
-void Pwm::UD(long speed, long drift ) {
-    // Aumenta e riduce in sequenza la luminosita' usanndo millis()
-    shift = drift;
-    brightness = 128 + 127 * cos(2 * PI / speed * (millis() + shift));
-    analogWrite(ledPin, brightness);
-}
-
-void Pwm::Set(byte brightness) {
-    // Imposta il valore del PWM
-    analogWrite(ledPin, brightness);
-}
-
-
-void Pwm::lSet(byte brightness) {
-    // Imposta il valore del PWM con correzione luminosita' LED
-    analogWrite(ledPin, lum(brightness));
-}
-
-
-/////////////////////////////////////
-// Sequenza
-// Constructor
-Sequenza::Sequenza (byte passed[], byte dim) {
-    ledPins = passed ;
-    size = dim ;
-    for (int thisPin = 0; thisPin < size; thisPin++) {
-        pinMode(ledPins[thisPin], OUTPUT);
-    }
-    previousMillis = millis();
-    digitalWrite(ledPins[0], HIGH);
-}
-
-void Sequenza::Update(long value) {
-    // Incrementa dal primo all'ultimo valore dell'array
-    interval = value;
-    if (millis() - previousMillis >= interval) {
-        previousMillis = millis();
-
-        if ( i < size - 1 ) {
-            // Spegni precedente led
-            digitalWrite(ledPins[i], LOW);
-
-            // Accendi successivo led
-            digitalWrite(ledPins[++i], HIGH);
-        }
-
-        else if  (i == size - 1 )   {
-            // Ultimo caso
-            i = 0;
-            previousMillis = millis();
-            digitalWrite(ledPins[i], HIGH);
-            digitalWrite(ledPins[ size - 1 ], LOW);
-        }
-    }
-}
-
-
-void Sequenza::Reverse(long value) {
-    interval = value;
-    if (millis() - previousMillis >= interval) {
-        previousMillis = millis();
-
-        if  (i == 0)   { // Entry point, ultimo LED
-            digitalWrite(ledPins[size -1],HIGH);
-            digitalWrite(ledPins[0],LOW);
-            i = size -1 ;
-        }
-        else {
-            digitalWrite(ledPins[i],LOW);
-            digitalWrite(ledPins[--i],HIGH);
-        }
-    }
-}
-
-void Sequenza::UD(long value) {
-    interval = value;
-    if (millis() - previousMillis >= interval) {
-        previousMillis = millis();
-        // Spegni precedente led
-        digitalWrite(ledPins[i], LOW);
-        i = i + inc ;
-        // Accendi successivo led
-        digitalWrite(ledPins[i], HIGH);
-
-        if (i == 0 || i == size -1) {
-            inc = -inc ;
-        }
-    }
-}
-
-
-//////////////////
-// Funzioni
-
-
-void brilla(byte pin, int velocita ) { // Defalt value di velocita' solo nell'Header
-    // Accende e spegne il LED accetando un argomento
-    // per impostare la velocita'.
-
-    pinMode(pin, OUTPUT);
-    // sequenze di istruzione: accendere e spegnere il LED
-    digitalWrite(pin, HIGH);   // turn the LED on (HIGH is the voltage level)
-    delay(velocita);               // wait for a second
-    digitalWrite(pin, LOW);    // turn the LED off by making the voltage LOW
-    delay(velocita);               // wait for a second
-};
-
-
-byte lum(byte val) {
-    // Mappatura dell'intervallo 0-255 con correzione di luminosita.
-    // storata in SRAM
-    return pgm_read_byte_near(BCORRECT + val);
-};
-
-
-int calibraTrim(int pin) {
-    /* START Calibrazione TRIM canale:
-       Lettura di 10 smaple
-       calcolo del valore medio esclusi gli 0
-
-       I canali come alettoni / elevatore possono avere un TRIM
-       (generalmente il throttle non ha un TRIM impostato),
-       questa funzione nel setup serve per trovare il punto medio
-       all'avvio dello sketch.
-     */
-    const byte ledPin = 13;
-    pinMode(ledPin,OUTPUT);
-    byte a 		= 0;
-    int servoValue 	= 0;
-    int middle = 0; 
-    Serial.println(">> Calibrazione: ");
-    while (a < 10) {
-        if (millis() > 10000) {
-            Serial.println(">> Calibrazione annullata a causa di assenza di seganle. \nAssicurarsi di accendere radio e ricevente \ne ripetere la procedura.");
-            middle = 15000; // Return value is divided by 10
-            break;
-        };
-        servoValue = pulseIn(pin, HIGH, 25000);
-        if (servoValue != 0 && servoValue > 1000 && servoValue <2000)  {
-            middle = middle + servoValue ;
-            a++ ;
-            Serial.print(servoValue);
-            Serial.print(": ");
-            Serial.println(middle / a);
-            digitalWrite(ledPin, !digitalRead(ledPin));
-            delay(100);
-        }
-    }
-    Serial.print(">> Fine Calibrazione, media: ");
-    Serial.println(middle / 10);
-    Serial.flush() ;
-    return(middle / 10) ;
-// END calibrazione
-};
-
diff --git a/libraries/common/examples/sequenza/sequenza.ino b/libraries/common/examples/sequenza/sequenza.ino
index bb9b46b..8a319d4 100644
--- a/libraries/common/examples/sequenza/sequenza.ino
+++ b/libraries/common/examples/sequenza/sequenza.ino
@@ -24,7 +24,7 @@ byte pins[] = {  // PIN dei LED che compongono la sequenza
 Sequenza seq = Sequenza(pins,sizeof(pins)); // Array dei PINs, quanti elementi compongono l'array
 
 void loop() {
-  seq.Update(200); // Passa al segmento suciessivo ogni 200ms
+  seq.Update(200); // Passa al segmento successivo ogni 200ms
 };
 
 
diff --git a/libraries/common/keywords.txt b/libraries/common/keywords.txt
index 1ef357b..4e2d133 100644
--- a/libraries/common/keywords.txt
+++ b/libraries/common/keywords.txt
@@ -28,3 +28,4 @@ lSet		KEYWORD2
 lum			KEYWORD2	
 Sequenza 		KEYWORD1
 Update		KEYWORD2	
+calibraTrim			KEYWORD2	
-- 
2.39.2