This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const darkThemeColors = new Map([ | |
['primary', '#68e0cf'], | |
['secondary', '#585d65'], | |
['text', '#edf8f4'], | |
['background', '#373b40'] | |
]); | |
const lightThemeColors = new Map([ | |
['primary', '#309485'], | |
['secondary', '#a7adcb'], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void msDelay(int ms) | |
{ | |
unsigned long pl = millis(); | |
while (1) // infinite loop | |
{ | |
if ((millis() - pl) > ms) // if certain delay trigger | |
break; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "pico/stdlib.h" | |
bool state; | |
const uint LED_PIN = 25; | |
// Debounce control | |
unsigned long time = to_ms_since_boot(get_absolute_time()); | |
const int delayTime = 50; // Delay for every push button may vary | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const byte led_pin = LED_BUILTIN; | |
const byte interrupt_pin = 2; | |
volatile byte state = LOW; | |
unsigned long interrupt_time = millis(); | |
const unsigned long delay_time = 50; // Delay for every push button may vary | |
void setup() { | |
pinMode(led_pin, OUTPUT); | |
pinMode(interrupt_pin, INPUT_PULLUP); |