Skip to content

Instantly share code, notes, and snippets.

@benevpi
benevpi / stepcounter.ino
Created July 7, 2020 09:45
A simple step counter watch for lilygo2020 v1. Note - also needs a config.h
#include "config.h"
// ToDO
// There's a power bug that stops the screen going to sleep if the USB's been unpowered
// This also doesn't update the steps if the screen's been off UNLESS there's one more step (interrrupt)
// Get weather from wifi IF it's being charged
// Make it last a day comfortably of full use
// Save steps per day between power downs
// upload steps somewhere? Google Sheets?
@benevpi
benevpi / main.py
Created May 21, 2020 13:07
a micropython for turning an io pin on or off based on an Adafruit IO feed
import network
import time
from umqtt.robust import MQTTClient
import os
import sys
from machine import Pin
ADAFRUIT_IO_URL = b'io.adafruit.com'
ADAFRUIT_USERNAME = b'<insert username here>'
ADAFRUIT_IO_KEY = b'<insert Adafruit IO key here>'
@benevpi
benevpi / code.py
Created April 22, 2020 15:51
enviroplus featherwing gauge example
import time
import board
from pimoroni_envirowing import gas
from pimoroni_envirowing import screen
from gauge import Gauge
import displayio
import terminalio
import busio
@benevpi
benevpi / code.py
Created April 16, 2020 20:14
guage test circuit python
"""CLUE Spirit Level Demo"""
import board
from adafruit_clue import clue
from adafruit_display_shapes.triangle import Triangle
import displayio
import time
import math
display = board.DISPLAY
@benevpi
benevpi / code.py
Created April 3, 2020 10:31
Final Circuit Python frequency locator for Adafruit Clue
import array
import board
import audiobusio
import ulab
import ulab.extras
import ulab.vector
fft_size = 2048
@benevpi
benevpi / two-phase bargraph.py
Last active April 3, 2020 10:39
Circuit Python spectrometer with fading(ish) line graph on the clue
"""Waterfall FFT demo adapted from
https://teaandtechtime.com/fft-circuitpython-library/
to work with ulab on Adafruit CLUE"""
import array
import board
import audiobusio
import displayio
import ulab
"""Waterfall FFT demo adapted from
https://teaandtechtime.com/fft-circuitpython-library/
to work with ulab on Adafruit CLUE"""
import array
import board
import audiobusio
import displayio
import ulab
#include <ArduinoJson.h>
#include <WiFiClientSecure.h>
#define LOG_LOCAL_LEVEL ESP_LOG_VERBOSE
#include "esp_log.h"
// WiFi network name and password:
const char * networkName = "YOUR NETWORK SSID HERE";
#include <LiquidCrystal.h>
LiquidCrystal lcd(21, 19, 17, 16, 15, 14);
byte star_1[8] = {
B00000,
B00000,
B00000,
B00100,
B00000,
#include <LiquidCrystal.h>
LiquidCrystal lcd(21, 19, 17, 16, 15, 14);
void setup() {
lcd.begin(16, 2);
lcd.print("hello");
lcd.setCursor(0,1);
lcd.print("world");
}