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.
Dependencies: mbed
Diff: RobotFinale.cpp
- Revision:
- 13:459e008582b3
- Parent:
- 12:00ce5d30b82c
- Child:
- 14:d58d474fae35
diff -r 00ce5d30b82c -r 459e008582b3 RobotFinale.cpp --- a/RobotFinale.cpp Thu Nov 22 00:42:32 2018 +0000 +++ b/RobotFinale.cpp Sat Nov 24 13:30:24 2018 +0000 @@ -91,22 +91,20 @@ // Output Digitali usati per i LED DigitalOut LedWAD (PC_2); DigitalOut LedWAS (PC_3); -DigitalOut LedWPD (PC_10); +DigitalOut LedWPD (PH_0); DigitalOut LedWPS (PA_0) ; -/*XXXXXXXX ATTENZIONE NON UTILIZZABILE COME LED PERCHE' UTILIZZATO DA IHM05A1 XXXXXXX -DigitalOut LedYAD (PC_13); -*/ -DigitalOut LedYAS (PC_14); -DigitalOut LedRPD (PC_12); -/*XXXXXXXX ATTENZIONE NON UTILIZZABILE COME LED PERCHE' UTILIZZATO DA SENSORE DI LUMINOSITA' XXXXXXX -DigitalOut LedRPS (PA_1) ; -*/ +DigitalOut LedYAD (PC_6); +DigitalOut LedYAS (PC_9); +DigitalOut LedRPD (PA_13); +DigitalOut LedRPS (PA_14) ; + + // Input/Output Digitali usati per interfaccia RPI DigitalIn InLightSwitchRPI (PB_9); // accende e spegne le Luci rosse e gialle = GPIO20 DigitalIn InMotorSwitchRPI (PB_8); // accende e spegne il motore = RPI GPIO16 DigitalIn InFutureUse0RPI (PB_7); // usi futuri 0 di comunicazione = RPI GPIO13 DigitalIn InFutureUse1RPI (PB_2); // usi futuri 1 di comunicazione = RPI GPIO25 -DigitalIn InFutureUse2RPI (PC_15); // usi futuri 1 di comunicazione = RPI GPIO12 +DigitalIn InFutureUse2RPI (PC_15); // usi futuri 2 di comunicazione = RPI GPIO12 /****************************************************************************/ /* Initialization parameters of the motor connected to the expansion board. */ @@ -291,16 +289,29 @@ //++++++++++++++ INIZIO Accensione LED da comando Raspberry +++++++ if(InLightSwitchRPI ==1) { + // accendi i LED di abbellimento - led2=1; + //led2=1; + LedYAD = 1; + LedYAS = 1; + LedRPD = 1; + LedRPS = 1; + } else { + // spegni i LED di abbellimento - led2=0; + //led2=0; + LedYAD = 0; + LedYAS = 0; + LedRPD = 0; + LedRPS = 0; + } //++++++++++++++ INIZIO Accensione LED da comando Raspberry +++++++ - //++++++++++++ INIZIO Misura della Luminosità e accensione LED ++++++++++++++ + + //++++++++++++ INIZIO Misura della Luminosità e accensione LED Bianchi ++++++++++++++ // inizializza il valore medio della Luminosità fAvgLight=0.0; for(nIndex=0; nIndex < NUMLIGHTSAMPLE; nIndex++) @@ -317,11 +328,25 @@ // Accendi LED Bianchi se illuminazione è sottosoglia if(fAvgLight < SOGLIALUCI) { - led2 = 1; + + // Accendi LED Bianchi + //led2 = 1; + LedWAD = 1; + LedWAS = 1; + LedWPD = 1; + LedWPS = 1; + } else { - led2 = 0; + + // Spegni LED Bianchi + //led2 = 0; + LedWAD = 0; + LedWAS = 0; + LedWPD = 0; + LedWPS = 0; + } // invia il dato al PC