Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python3
#Originally be Alasdair Allen (see below), modified by Ben Everard 2023
# Copyright (c) 2022 Raspberry Pi Ltd
# Author: Alasdair Allan <[email protected]>
# SPDX-License-Identifier: BSD-3-Clause
# A TensorFlow Lite example for Picamera2 on Raspberry Pi OS Bullseye
#
@benevpi
benevpi / code.py
Created October 13, 2023 16:14
ambient noise generator
# SPDX-FileCopyrightText: 2023 John Park
#
# SPDX-License-Identifier: MIT
# Ambient Machine inspired by Yuri Suzuki https://www.yurisuzuki.com/projects/the-ambient-machine
import os
import gc
import board
import audiocore
import audiobusio
import audiomixer
@benevpi
benevpi / imagerec.py
Created September 29, 2023 14:52
tflite with picamera 2
#!/usr/bin/python3
# Copyright (c) 2022 Raspberry Pi Ltd
# Author: Alasdair Allan <[email protected]>
# SPDX-License-Identifier: BSD-3-Clause
# A TensorFlow Lite example for Picamera2 on Raspberry Pi OS Bullseye
#
# Install necessary dependences before starting,
#
@benevpi
benevpi / blink.h
Created July 19, 2023 15:08
Arduino Uno R4 blinking eye animation H file
@benevpi
benevpi / blink.mpy
Created July 19, 2023 15:07
Arduino Uno R4 blinking eye
import board
#from hx711.hx711_pio import HX711_PIO
from hx711.hx711_gpio import HX711_GPIO
import time
import usb_hid
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS
from adafruit_hid.keycode import Keycode
from digitalio import DigitalInOut, Direction, Pull
import board
from hx711.hx711_pio import HX711_PIO
import time
import usb_hid
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS
from adafruit_hid.keycode import Keycode
keyboard = Keyboard(usb_hid.devices)
keyboard_layout = KeyboardLayoutUS(keyboard)
import board
from hx711.hx711_pio import HX711_PIO
import time
print("initialising")
pin_data = board.GP2
pin_clk = board.GP3
hx1 = HX711_PIO(board.GP2, board.GP3, tare=True)
hx2 = HX711_PIO(board.GP6, board.GP7, tare=True)
# Write your code here :-)
import time
import board
from analogio import AnalogIn
import usb_hid
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS
from adafruit_hid.keycode import Keycode
bash_key = Keycode.SPACE
import network
import urequests
import json
import time
from machine import Pin
from secrets import secrets
import machine
print("starting connection")
wlan = network.WLAN(network.STA_IF)