🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Stamp C nonblocking led script?

    General
    4
    4
    4.0k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      Knobsi
      last edited by

      Hello together,
      using my Stamp C but cannot get the button led running without blocking.
      anybody can point me to a sample for this?
      would be great !

      Thx & cheers, K.

      1 Reply Last reply Reply Quote 0
      • felmueF
        felmue
        last edited by felmue

        Hello @Knobsi

        here is a simple non-blocking blinking example for the M5StampC3.

        Thanks
        Felix

        GPIO translation table M5Stack / M5Core2
        Information about various M5Stack products.
        Code examples

        1 Reply Last reply Reply Quote 0
        • M
          macsbug
          last edited by macsbug

          Hello @Knobsi

          The RGB LED can use the neopixel Write instruction with Arduino ESP32 Version 2.0.4.

          Arduino IDE Boards Manager
          Arduino ESP32 Version 2.0.4
          https://github.com/espressif/arduino-esp32/releases?fbclid=IwAR19R5_0Y1bW5DiYk4PBp7RAeFKjNrSo9YJZuHXmwNKY-dT7z_fYDKHzSoI
          Improvements

          • Implemented a simple RGB driver via digitalWrite
          • Implement simple RGB driver via digitalWrite; solving #6783 by @PilnyTomas in #6808

          :
          https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/esp32-hal-rgb-led.h
          void neopixelWrite(uint8_t pin, uint8_t red_val, uint8_t green_val, uint8_t blue_val);
          :

          #define LED_PIN 2

          void setup() {
          neopixelWrite(LED_PIN,10,100,200); // GPIO,R,G,B
          }

          void loop() {
          }

          1 Reply Last reply Reply Quote 0
          • A
            AgreeDK
            last edited by AgreeDK

            You can make a new class , create a task to control blink or not, and color, with only one function call in you main code . I have done it, but is on vacation now, so cant share it.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post