X-Git-Url: http://git.piffa.net/web?a=blobdiff_plain;f=advanced_projects%2Fstate_machine%2Fsemaforo_2_stimolo%2Fsemaforo_2_stimolo.ino;fp=advanced_projects%2Fstate_machine%2Fsemaforo_2_stimolo%2Fsemaforo_2_stimolo.ino;h=9b4b3678dd4729c685566041295c76972796a5dc;hb=c245a4e670fe2a2d44188a22f7fd6529e11bafc8;hp=e31949ffd88225048b6f13bd1d1d3c2e030ac77f;hpb=0a29fddb5e1ffdf64f5a06e84287895b402914ad;p=sketchbook_andrea diff --git a/advanced_projects/state_machine/semaforo_2_stimolo/semaforo_2_stimolo.ino b/advanced_projects/state_machine/semaforo_2_stimolo/semaforo_2_stimolo.ino index e31949f..9b4b367 100644 --- a/advanced_projects/state_machine/semaforo_2_stimolo/semaforo_2_stimolo.ino +++ b/advanced_projects/state_machine/semaforo_2_stimolo/semaforo_2_stimolo.ino @@ -80,9 +80,11 @@ Serial.println(state); } /* Domande: - 1. Introdurre un secondo semaforo che cambia stato quando viene attivato + 1. Introdurre una memoria nello stato green che tenga traccia della pressione del bottone + per lo stato succiessivo. + 2. Introdurre un secondo semaforo che cambia stato quando viene attivato lo stimolo. - 2. L'uso di delay() puo' essere limitativo: come rimediare? + 3. L'uso di delay() puo' essere limitativo: come rimediare? . . . @@ -94,6 +96,6 @@ Serial.println(state); . . Soluzioni -2. Si potrebbe utilizzare un interrupt per gli stimoli oppure millis() +3. Si potrebbe utilizzare un interrupt per gli stimoli oppure millis() per gestire le pause. */