18.08.2013 Views

UNIVERSITA' DEGLI STUDI DI PAVIA - Robotica

UNIVERSITA' DEGLI STUDI DI PAVIA - Robotica

UNIVERSITA' DEGLI STUDI DI PAVIA - Robotica

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

dei parametri rappresentano i codici ASCII dei tasti che devono essere premuti per<br />

terminare il loop: i tasti possibili sono 2 per poter gestire la terminazione in modo<br />

il case-unsensitive, cioè consentire la terminazione del loop sia quando viene<br />

premuta la maiuscola che la minuscola, nel caso di tasti alfabetici. Se si desidera<br />

condizionare il ciclo con un solo tasto (per esempio ESC) basta porre entrambi i<br />

parametri uguali allo stesso valore.<br />

YES<br />

Start<br />

key_waiting = 1<br />

YES<br />

Read Key<br />

Key = kw1<br />

or<br />

Key = kw2<br />

NO<br />

*f = NULL<br />

NO<br />

execute<br />

f(Key)<br />

Figura 5.12. Diagramma di flusso di wait_for_key().<br />

132<br />

NO<br />

YES<br />

Exit

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!