commit 78a2506f5ed1d68ae62ee8bf0f98f6502d20c77c Author: vgaNAR6ta Date: Tue Jun 16 18:41:49 2026 +0200 ébauche lampe bande led diff --git a/333-test.ino b/333-test.ino new file mode 100644 index 0000000..2c62956 --- /dev/null +++ b/333-test.ino @@ -0,0 +1,82 @@ +#include + +/*==========variables LED*/ +constexpr uint8_t NBR_LED = 40; + +constexpr uint8_t DATA = 27; +constexpr uint8_t CLOCK = 26; + +constexpr uint8_t BRIGHTNESS = 255; + +CRGB leds[NBR_LED]; + +/*===========commutateur ambiance*/ +constexpr uint8_t AMBIANCE_CHECK = 22; + +/*============on:off*/ +constexpr uint8_t ON_CHECK = 23; + +/*===========animation aller-retour*/ +void loadingAnimation(){ + for(int i = 0; i(leds, NBR_LED); + FastLED.setBrightness(BRIGHTNESS); + + FastLED.clear(); + leds[3] = CRGB::Red; + FastLED.show(); + FastLED.clear(); + + pinMode(AMBIANCE_CHECK, INPUT_PULLUP); + pinMode(ON_CHECK, INPUT_PULLUP); +} + +void loop(){ + if(digitalRead(ON_CHECK)==LOW){ + if(digitalRead(AMBIANCE_CHECK)==LOW){ + loadingAnimation(); + } + else{ + allBright(); + } + } + else{ + FastLED.clear(); + } +} \ No newline at end of file