Skip to content

Instantly share code, notes, and snippets.

import network
import socket
import time
import struct
from machine import Pin
NTP_DELTA = 2208988800
host = "pool.ntp.org"
@N3MIS15
N3MIS15 / beacon.py
Last active October 28, 2025 23:26
micropython iBeacon example
import struct
import ubluetooth as bt
from micropython import const
MANUFACTURER_ID = const(0x004C)
DEVICE_TYPE = const(0x02)
DATA_LENGTH = const(0x15)
BR_EDR_NOT_SUPPORTED = const(0x04)
FLAG_BROADCAST = const(0x01)
MANUFACTURER_DATA = const(0xFF)
@TheFlyingCorpse
TheFlyingCorpse / neopixel-flicker.py
Created August 2, 2018 12:51
Fire / flicker neopixel ledstrip WS2812B
#!/usr/bin/env python3
# Based off of http://www.walltech.cc/neopixel-fire-effect/ for Arduino
# Works with Raspbian Stretch on the RPi3
import time
from neopixel import *
import argparse
# LED strip configuration:
LED_COUNT = 220 # Number of LED pixels.
@StefanPetrick
StefanPetrick / Noise_smoooooth.ino
Last active April 6, 2022 18:31
Proof of concept for smooth fading
/*
A FastLED matrix example:
A simplex noise field fully modulated and controlled by itself
written by
Stefan Petrick 2017
Do with it whatever you like and show your results to the FastLED community
https://plus.google.com/communities/109127054924227823508
*/
#include "FastLED.h"
@pruppert
pruppert / WeMo.py
Last active June 23, 2023 08:57
This is a python script that can control a local WeMo switch as long as you know the local IP of the WeMo. The script is a fork of pdumoulin's blinky: https://github.com/pdumoulin/blinky.
#!/usr/bin/python
import re
import urllib2
# Configuration:
# Enter the local IP address of your WeMo in the parentheses of the ip variable below.
# You may have to check your router to see what local IP is assigned to the WeMo.
# It is recommended that you assign a static local IP to the WeMo to ensure the WeMo is always at that address.
# Uncomment one of the triggers at the end of this script.