• Holger Lembke's avatar
    Add: make digitalRead() for RGB_BUILTIN work (#9419) · e92b4ca6
    Holger Lembke authored
    * make digitalRead() for RGB_BUILTIN work
    
    Standard Arduino-Way of blinking a LED can be the shortest with:
    
    void loop() {
      static uint32_t ledticker = 0;
      if (millis() - ledticker > 1000) {
        ledticker = millis();
        digitalWrite(RGB_BUILTIN, !digitalRead(RGB_BUILTIN));
      }
    }
    
    Worked with the old LED_BUILTIN on Pin 2, now even works with Pin 48/neopixel.
    
    * Add: make digitalRead() for RGB_BUILTIN work
    
    Standard Arduino-Way of blinking a LED can be the shortest with:
    
    void loop() {
      static uint32_t ledticker = 0;
      if (millis() - ledticker > 1000) {
        ledticker = millis();
        digitalWrite(RGB_BUILTIN, !digitalRead(RGB_BUILTIN));
      }
    }
    
    Worked with the old LED_BUILTIN on Pin 2, now even works with Pin 48/neopixel.
    
    (Retry. Didn't sync my local sources. Sorry.)
    e92b4ca6
esp32-hal-gpio.c 8.84 KB