4 2 LED / Strisce laterali che lampeggiano alternativamente
5 1 LED / Striscia sotto in FADE
7 Lettura del canale Throttle (3) con la funzione Pulsein
13 Lampeggiatore left = 12;
14 Lampeggiatore right = 11;
18 const byte thrPin = 3; // PIN collegato al CH3
19 byte thr ; // Valore a 8bit per il throttle
20 int thrIn ; // Valore rilevato del 3 Ch della RX
21 const int thMin = 983; // In genere il valore minimo del TH resta costante,
22 // per calcolarlo si puo' usare la funzione di calibrazione nel setup
26 // I PINs vengono impostati dal constructor al momento
27 // della dichiarazione dell'ogetto.
29 right.Invert() ; // Opzionale: inverte l'ordine del lampeggio da
30 // HI -> LOW --> LOW -> HI
31 // per avere 2 LED che lampeggiano alternativamente
36 thrIn = pulseIn(thrPin, HIGH, 25000);
37 if (thrIn >= thMin && thrIn < 2000) { // clean up
38 thr = map(thrIn, thMin, 2000, 0, 255); // mappato su 8bit per PWM
42 left.Blink(100 + thr);
43 right.Blink(100 + thr);
44 sotto.lSet(thr); // Luminosita' proporzionale al throttle