/** ****************************************************************************************
* \mainpage 
*
* @brief Classe led e pulsanti struttura di base 
* test con tre led e tre pulsanti, aggiunta del monitor seriale
* https://wokwi.com/projects/388886429069240321
* 
* @author Filippo Bilardo
* @date 11/02/24
* @version 1.1 11/02/24 Versione iniziale
*/
//------------------------------------------------------------------------------------------
//=== INCLUDES =============================================================================
//------------------------------------------------------------------------------------------
#include "LED.h"
#include "Pulsante.h"

//------------------------------------------------------------------------------------------
//=== CONSTANTS ============================================================================
//------------------------------------------------------------------------------------------
#define LED1_PIN 12
#define LED2_PIN 11
#define LED3_PIN 10
#define P1_PIN 6
#define P2_PIN 5
#define P3_PIN 4

//------------------------------------------------------------------------------------------
//=== LOCAL VARIABLES ======================================================================
//------------------------------------------------------------------------------------------
LED led1(LED1_PIN); // creiamo un'istanza della classe LED su pin 12
LED led2(LED2_PIN);
LED led3(LED3_PIN);
Pulsante P1(6);
Pulsante P2(5);
Pulsante P3(4);

//------------------------------------------------------------------------------------------
//=== SETUP ================================================================================
//------------------------------------------------------------------------------------------
void setup(void) {
  Serial.begin(9600); // Inizializza la comunicazione seriale
  Serial.println("Setup...");
  led1.accendi();
  led2.test(0);
  led3.test(1);
  led1.spegni();
  Serial.println("Avvio...");
}

//------------------------------------------------------------------------------------------
//=== MAIN LOOP ============================================================================
//------------------------------------------------------------------------------------------
void loop(void) {
   
  P1.press() ? led1.accendi() : led1.spegni();
  //if(P2.longPress()) led2.inverti();

}
$abcdeabcde151015202530fghijfghij