Faire clignoter une led bleu et rouge sur nodemcu v3 via arduino ide
Rédigé par hack4 -
-
aucun commentaire
#define ESP_MODULE_TYPE 'ESP-12E'
#if ESP_MODULE_TYPE == 'ESP-01'
static const uint8_t LEDrouge = 0; // GPIO 0;
static const uint8_t LEDbleue = 2; // GPIO 2;
#elif ESP_MODULE_TYPE == 'ESP-12E'
static const uint8_t LEDrouge = D0; // GPIO 16;
static const uint8_t LEDbleue = D4; // GPIO 2;
#endif
static const uint8_t LEDhigh = 0;
static const uint8_t LEDlow = 1;
void setup()
{
Serial.begin( 115200 );
Serial.print( "\n\nSTART\n" );
pinMode( LEDbleue, OUTPUT );
pinMode( LEDrouge, OUTPUT );
digitalWrite( LEDbleue, LEDlow );
digitalWrite( LEDrouge, LEDlow );
Serial.print( "FIN DU SETUP\n" );
}
void loop()
{
digitalWrite( LEDbleue, LEDhigh );
digitalWrite( LEDrouge, LEDlow );
delay( 120 );
digitalWrite( LEDbleue, LEDlow );
digitalWrite( LEDrouge, LEDhigh );
delay( 60 );
Serial.print( "." );
}