Skip to content

Instantly share code, notes, and snippets.

@peyanski
peyanski / ESPHome-YAML-ld2410-esp32.yaml
Last active May 12, 2024 11:56
Use this code to make your LD2410 sensor to work with ESP32 or ESP8266 board
esphome:
name: ld2410-esp32
friendly_name: ld2410-esp32
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
@boelle
boelle / roller_blind_control.yaml
Created January 30, 2021 19:52
Esphome code for roller blinds
# 1) Press button for > 1 second to enter setup mode
# 2) Press button again to start the blind closing
# 3) Press button again when closed and blind starts to open (actually resets the stepper position to 0)
# 4) Press button again when blind is fully open
# 5) Job Done
# Button is also used to open/close the blind (must be fully open/closed first)
esphome:
@cretep
cretep / example_ze08.yaml
Created November 1, 2020 09:38
Winsen ZE08-CH2O (Formaldehyde sensor) for ESPHome
esphome:
includes:
- winsen_ze08.h
uart:
- id: uart_ze08
rx_pin: GPIO16
tx_pin: GPIO17
baud_rate: 9600
/*********************************************************************
maskdisplay.ino
Arduino code adapted from adafruit examples to display text to e-ink via bluetooth.
- Josh Bloom (2020)
This is an example for our nRF51822 based Bluefruit LE modules
Pick one up today in the adafruit shop!
Adafruit invests time and resources providing this open source code,
@duanebester
duanebester / Arduino-Tracker.ino
Created July 29, 2020 22:41
Arduino Tracker Datalogger Code
#include <SparkFun_Ublox_Arduino_Library.h>
#include <Arduino_LSM9DS1.h>
#include <Arduino_APDS9960.h>
#include <SPI.h>
#include <SD.h>
//
// ---- For Arduino Nano 33 BLE Sense board ----
// Connected to MKR Mem Shield & MKR GPS Shield
// ~ Note: GPS Module connected by UART
@metalinspired
metalinspired / main.cpp
Last active May 1, 2024 21:00
TMC2209 UART
/**
* Author Milan Divkovic
*
* You can control the motor with following commands:
* 0: Disables the motor
* 1: Enables the motor
* + or -: Increase or decrease speed in respect to rotation direction
*/
#include <Arduino.h>
# Descriptioon of the sequence below:
#
# AT+... <- AT Command sent to modem
# OK <- Modem Response
//Switch the modem to minimum functionality
AT+CFUN=0,0
OK
// Verbose Error Reporting to get understandable error reporting (optional)
@epietrowicz
epietrowicz / ble_led.py
Created October 30, 2019 14:38
Simple script using built in RGB LED on nrf52840 usb dongle
from adafruit_ble.uart import UARTServer
import time
import board
from digitalio import DigitalInOut, Direction, Pull
uart = UARTServer()
Rled = DigitalInOut(board.LED2_R)
Bled = DigitalInOut(board.LED2_B)
Gled = DigitalInOut(board.LED2_G)
// Default sensors address for BME280
let BME280_I2C_ADDRESS = 0x76;
let BQ27441_I2C_ADDRESS = 0x55;
let BQ27441_COMMAND_CONTROL = 0x00; // Control
let BQ27441_COMMAND_TEMP = 0x02; // Temperature 0.1°K
let BQ27441_COMMAND_VOLTAGE = 0x04; // Voltage mV
let BQ27441_COMMAND_FLAGS = 0x06; // Flags
let BQ27441_COMMAND_NOM_CAPACITY = 0x08; // NominalAvailableCapacity mAh
let BQ27441_COMMAND_AVAIL_CAPACITY = 0x0A; // FullAvailableCapacity mAh
@urish
urish / circuitpython-mouse-hid-hello.py
Last active June 12, 2024 17:16
Open "MSPaint", set the foreground color to black, background color to red, and then run this script. Enjoy!
import time
import board
import digitalio
from adafruit_hid.mouse import Mouse
print("Hello!")
led = digitalio.DigitalInOut(board.LED1)
led.direction = digitalio.Direction.OUTPUT
led.value = False