Skip to content

Instantly share code, notes, and snippets.

View peeranatkankham's full-sized avatar

Peeranat Kankham peeranatkankham

View GitHub Profile
esphome:
name: co2
rp2040:
board: rpipicow
framework:
# Required until https://github.com/platformio/platform-raspberrypi/pull/36 is merged
platform_version: https://github.com/maxgerhardt/platform-raspberrypi.git
# Enable logging
logger:
# Enable Home Assistant API
#include "Button2.h"
#include <BleKeyboard.h>
BleKeyboard bleKeyboard;
#define BUTTON_A_PIN 16
#define BUTTON_B_PIN 17
#define BUTTON_C_PIN 5
#define BUTTON_D_PIN 18
#define BUTTON_E_PIN 23
#define BUTTON_F_PIN 19
from smars_library.smars_library import SmarsRobot
from pyPS4Controller.controller import Controller
import smars_library.smars_library as sl
SMARS = SmarsRobot()
# SMARS.invert_feet()
DRIVER = sl.DO_NOT_USE_PCA_DRIVER
class MyController(Controller):
def __init__(self, **kwargs):
import cv2
import requests
# Load the classifiers
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
body_cascade = cv2.CascadeClassifier('haarcascade_fullbody.xml')
# Set up the camera
cap = cv2.VideoCapture(0)
#define F_CPU 16000000UL
#include <avr/io.h>
#include <avr/interrupt.h>
#include <util/delay.h>
// Define the pin numbers for the sensors and the relay
#define LDR_PIN PB3
#define MOTION_PIN PB1
#define RELAY_PIN PB2
esphome:
name: multi-sensor-top-ceiling
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger: