Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 0:50aba42d784f, committed 2019-03-31
- Comitter:
- CarmineSql
- Date:
- Sun Mar 31 17:33:23 2019 +0000
- Commit message:
- public;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Mar 31 17:33:23 2019 +0000 @@ -0,0 +1,49 @@ + /*DOPPIO SEMAFORO CON PULSANTE*/ + //CAIAZZO ROMANO e SQUILLACE 3Ai + +#include "mbed.h" //inclusione librerie mbed + +DigitalOut r_m(D12); //LED ROSSO MACCHINE +DigitalOut g_m(D10); //LED GIALLO MACCHINE +DigitalOut v_m(D9); //LED VERDE MACCHINE + +DigitalOut r_p(D2); //LED ROSSO PEDONI +DigitalOut g_p(D4); //LED GIALLO PEDONI +DigitalOut v_p(D6); //LED VERDE PEDONI + +DigitalIn button(D3); //BOTTONE PEDONI \\(USER_BUTTON)=>BOTTONE di DEFAULT + +int main() { //ESEGUI: +while(1){ //loop: + //ACCENDI VERDE MACCHINE + r_m=0; + g_m=0; + v_m=1; + //ACCENDI ROSSO PEDONI + r_p=1; + g_p=0; + v_p=0; + if(button==1){ //QUANDO IL BOTTONE VIENE PREMUTO: + + v_m=0; //SPEGNI VERDE MACCHINA + r_p=0; //SPEGNI ROSSO PEDONE + + wait(1.0); //ASPETTA + + g_m=1; //ACCENDI GIALLO MACCHINA + + wait(2); //ASPETTA + + r_m=1; //ACCENDI ROSSO MACCHINA + g_m=0; //SPEGNI GIALLO MACCHINA + g_p=1; //ACCENDI GIALLO PEDONI + + wait(1.5); //ASPETTA + + v_p=1; //ACCENDI VERDE PEDONE + g_p=0; //SPEGNI GIALLO PEDONE + + wait(7); //ASPETTA + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun Mar 31 17:33:23 2019 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file