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 = 10;
14 Lampeggiatore right = 11;
17 // Quando il Throttle e' in IDE facciamo un PWM anche sui laterali
22 const byte thrPin = 3; // PIN collegato al CH3
23 byte thr ; // Throttle
28 // I PINs vengono impostati dal constructor al momento
29 // della dichiarazione dell'ogetto.
31 right.Invert() ; // Opzionale: inverte l'ordine del lampeggio da
32 // HI -> LOW --> LOW -> HI
33 // per avere 2 LED che lampeggiano alternativamente
35 randomSeed(analogRead(0));
40 thrIn = pulseIn(thrPin, HIGH, 25000);
41 thr = constrain(map(thrIn, 983, 2000, 0, 255), 0, 255) ;
44 if (thr > 0 && thr < 15) {
50 } else if (thr < 245) {
53 right.Blink(1120 - 4 * thr );
54 left.Blink(1120 - 4 * thr );
55 sotto.lSet(thr); // Luminosita' proporzionale al throttle
57 // Throttle al massimo: LED laterali lampeggiano a caso,
58 // Sotto luminosita' a caso
60 caso = random(20, 240) ;