Skip to content

Instantly share code, notes, and snippets.

import rp2
import time
from machine import Pin
import array
import math
import _thread
import random
import time
import rp2040_pio_dma
import uctypes
# Write your code here :-)
"""CircuitPython Essentials Digital In Out example"""
import time
import board
from digitalio import DigitalInOut, Direction
import touchio
# LED setup.
LED_pins = [board.GP0, board.GP1, board.GP2, board.GP3, board.GP4, board.GP5, board.GP6,
import time
import board
import busio
from simpleio import map_range
from analogio import AnalogIn
from digitalio import DigitalInOut, Direction
import usb_midi
import adafruit_midi # MIDI protocol encoder/decoder library
from adafruit_midi.control_change import ControlChange
from adafruit_midi.note_on import NoteOn
import time
import board
import busio
import usb_midi
import adafruit_midi
from adafruit_midi.note_on import NoteOn
from adafruit_midi.note_off import NoteOff
import random
USB_MIDI_channel = 1 # pick your USB MIDI out channel here, 1-16
# Write your code here :-)
import board
import digitalio
import gamepad
import time
import usb_hid
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
kbd = Keyboard(usb_hid.devices)
# Write your code here :-)
import time
import board
import busio
import usb_hid
from adafruit_bus_device.i2c_device import I2CDevice
import adafruit_dotstar
from adafruit_hid.keyboard import Keyboard
import time
import board
import neopixel
try:
import urandom as random
except ImportError:
import random
# Drive NeoPixels on the NeoPixels Block on Crickit for
# Circuit Playground Express
import time
import neopixel
import board
from adafruit_circuitplayground.express import cpx
from math import floor
num_pixels = 45 # Number of pixels driven from Crickit NeoPixel terminal
@benevpi
benevpi / soilmoisture.ino
Created August 27, 2020 13:41
A sketch for reading soil moisture levels and using Deep Sleep to preserve battery life on DIY More ESP32 soil boards
#include "DHT.h"
#include "esp_wifi.h"
#include <WiFi.h>
#include <ArduinoJson.h>
#include <HTTPClient.h>
//move to secrets
const char * networkName = "XXX";
const char * networkPswd = "XXX";
String AIOKey = "XXX";
@benevpi
benevpi / pedometer.ino
Created July 10, 2020 12:32
A more-working smart watch pedometer
#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?
// no need to do processing (such as time updates) if the screen is off.