]> git.piffa.net Git - sketchbook_andrea/blob - libraries/common/examples/sequenza/sequenza.ino
Sequenza con millis
[sketchbook_andrea] / libraries / common / examples / sequenza / sequenza.ino
1 /*
2   For Loop with millis()
3
4 Blink di un array di led in sucessione,
5 utilizzando millis() per non blocking.
6 L'array puo' contenere un numero arbitrario di led
7 (l'ordine in cui compaiono e' l'ordine in cui brillano).
8
9 OOP version.
10
11  Schemi:
12  - http://lab.piffa.net/schemi/8_led_single_res_bb.png
13  - http://lab.piffa.net/schemi/8_led_single_res_schem.png
14
15  http://www.arduino.cc/en/Tutorial/ForLoop
16  */
17 #include <common.h>
18 void setup() {
19 };
20
21 byte pins[] = {  // PIN dei LED che compongono la sequenza
22   2, 3, 4, 5, 6, 7
23 }; 
24 Sequenza seq = Sequenza(pins,sizeof(pins)); // Array dei PINs, quanti elementi compongono l'array
25
26 void loop() {
27   seq.Update(200); // Passa al segmento suciessivo ogni 200ms
28 };
29
30
31