#include #include /* red light slowly appears and disappear */ #define CPLAY_REDLED 13 static uint8_t limit; void setup() { init_neopixel_blit(); /* to ensure off regardless of prior sketch. */ pinMode(CPLAY_REDLED, OUTPUT); limit = 125; } void loop() { static uint8_t brightness; static uint8_t direction; delay(2000 / limit); analogWrite(CPLAY_REDLED, brightness); if(brightness == limit) { direction = -1; limit -= 1; brightness -= 1; } brightness += direction; if(brightness == 0) { direction = 1; } if(limit < 5) limit = 5; }