🤖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?

    Scheduled Pinned Locked Moved General
    4 Posts 4 Posters 5.5k Views
    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 Offline
      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 Offline
        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 Offline
          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 Offline
            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

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • First post
              Last post