From 78a2506f5ed1d68ae62ee8bf0f98f6502d20c77c Mon Sep 17 00:00:00 2001 From: vgaNAR6ta Date: Tue, 16 Jun 2026 18:41:49 +0200 Subject: [PATCH] =?UTF-8?q?=C3=A9bauche=20lampe=20bande=20led?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 333-test.ino | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 333-test.ino 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