Skip to content

Instantly share code, notes, and snippets.

@joeycastillo
joeycastillo / code.py
Last active August 21, 2024 15:41
Pycorder capacitive soil moisture demo
import time
import board
import busio
import displayio
import framebufferio
import sharpdisplay
import terminalio
import touchio
import adafruit_imageload
@adlerweb
adlerweb / LCDWiFi.ino
Created June 10, 2018 00:41
ESP8266 HD44780 WiFi
#include <LiquidCrystal.h>
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
const char *ssid = "freifunk-myk.de";
const char *password = "";
const char *netname = "esp-lcd";
# development way
if __name__ == '__main__':
app.run()
## server on http://127.0.0.1:5000/
## (invisible across the network) won't work on other device, other than development machine
# suggested way
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000)
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayDeque;
import java.util.Queue;
import java.util.Random;
public class MovingAverageV2 {
private final Queue<BigDecimal> window = new ArrayDeque<>();
private final int period;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@PurpleBooth
PurpleBooth / README-Template.md
Last active March 18, 2026 19:10
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@DenisFromHR
DenisFromHR / RPi_I2C_driver.py
Last active February 6, 2026 13:55
RaspberryPi I2C LCD Python stuff
# -*- coding: utf-8 -*-
"""
Compiled, mashed and generally mutilated 2014-2015 by Denis Pleic
Made available under GNU GENERAL PUBLIC LICENSE
# Modified Python I2C library for Raspberry Pi
# as found on http://www.recantha.co.uk/blog/?p=4849
# Joined existing 'i2c_lib.py' and 'lcddriver.py' into a single library
# added bits and pieces from various sources
# By DenisFromHR (Denis Pleic)
@bigjosh
bigjosh / NoPartsBatteryGauge.c
Last active April 7, 2022 09:51
Sample code for a no parts, no pins, no power supply voltage detection on ATTINY84
/*
* NoPartsBatteryGuageAVR.c
*
* This is a simplified demonstration of how to detect power supply voltage by using the on chip
* analog-to-digital converter to measure the voltage of the internal band-gap reference voltage.
*
* The code will read the current power supply voltage, and then blink an LED attached to pin 6 (PA7).
*
* 1 blink = 1 volts <= Vcc < 2 volts (only applicable on low voltage parts like ATTINY84AV)
* 2 blinks = 2 volts <= Vcc < 3 volts
@pklaus
pklaus / arduino-due_high-speed-ADC.ino
Last active September 5, 2025 12:45
Arduino Due: ADC → DMA → USB @ 1MSPS
#undef HID_ENABLED
// Arduino Due ADC->DMA->USB 1MSPS
// by stimmer
// from http://forum.arduino.cc/index.php?topic=137635.msg1136315#msg1136315
// Input: Analog in A0
// Output: Raw stream of uint16_t in range 0-4095 on Native USB Serial/ACM
// on linux, to stop the OS cooking your data:
// stty -F /dev/ttyACM0 raw -iexten -echo -echoe -echok -echoctl -echoke -onlcr
@egonSchiele
egonSchiele / canny.cpp
Created December 28, 2010 02:42
Adding automatic thresholding to cvCanny in OpenCV
// new
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//