Skip to content

Instantly share code, notes, and snippets.

#define CLK 2
#define DT 3
#define SW 4
int counter = 0;
int currentStateCLK;
int lastStateCLK;
String currentDir ="";
unsigned long lastButtonPress = 0;
esphome:
name: helloworld
esp32:
board: esp32dev
globals:
- id: my_global_int
type: float
restore_value: yes
sensor:
- platform: template
#include <termios.h>
#include <unistd.h>
#include <iostream>
struct termios original;
void enableRawMode() {
tcgetattr(STDIN_FILENO, &original);
struct termios raw = original;
cfmakeraw(&raw);
script:
   - id: state_on_off
     parameters:
        light_id: int
        rgb: int[]
        flash_for: int
     then:
       - lambda: |-
 static std::map light_map {