This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# AS5600 experiment on Raspberry Pi Pico (W, not that it makes any difference) | |
# | |
# A simple 3D printed test jig to explore the AS5600 is available at | |
# https://www.thingiverse.com/thing:7091000 | |
# Import necessary libraries for CircuitPython | |
import time | |
import board | |
import busio | |
import adafruit_as5600 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries | |
# SPDX-License-Identifier: MIT | |
"""Simpletest Example that shows how to get temperature, | |
pressure, and altitude readings from a bme680""" | |
import time | |
import board | |
# import digitalio # For use with SPI | |
import busio |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import RPi.GPIO as GPIO | |
import time | |
GPIO.setwarnings(False) | |
GPIO.setmode(GPIO.BOARD) | |
GPIO.setup(11, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) # output from PIR motion sensor | |
def motion(channel): | |
print("Sensed motion") | |
GPIO.add_event_detect(11, GPIO.RISING, callback=motion, bouncetime=300) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
app = Flask(__name__) | |
from app import routes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Copyright © 2020 Wesley Peters | |
* License: Creative Commons Attribution Non-Commercial License V2.0 | |
* License details are available at https://creativecommons.org/licenses/by-nc/2.0/ | |
*/ | |
#include <signal.h> | |
#include <stdbool.h> | |
#include <stdio.h> | |
#include <stdlib.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright © 2020 Wesley Peters | |
# License: Creative Commons Attribution Non-Commercial License V2.0 | |
# License details are available at https://creativecommons.org/licenses/by-nc/2.0/ | |
from gpiozero import LED | |
from time import sleep | |
def cpuTemp(): | |
cpuTemp.sf.seek(0, 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PySimpleGUI as sg | |
import hashlib | |
sg.change_look_and_feel('DarkAmber') # Add a touch of color | |
# All the stuff inside your window. | |
layout = [ [sg.Text('Username:'), sg.InputText()], | |
[sg.Text('Password'), sg.InputText()], | |
[sg.Button('Ok')] ] | |
canned_password = b"\x01~\xd8\x95\x0b\xd3\x1e*t\xfc\xac\x89\xa9\x1b\x9c&T\x1dc\x0b\xa7\xb2<'\x18\x1c\xe2\xfd_Jm\x92" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python | |
# | |
# Tickle an MCP23S17 DIO Expander on SPI 0,0 | |
# and an MCP4901 DAC on SPI 0,1 | |
import spidev | |
import sys | |
import time | |
# MCP23S17 register addresses |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// User-modifiable parts | |
const int sampleRate = 500; // microseconds | |
#define nSamples 100000 | |
// End of user-modifiable parts! | |
const int inputPin = A0; | |
const int outputPin = A22; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
# "Mood Hat" for Raspberry Pi with Sense Hat | |
# | |
# Display a sort of graphical state of the system on the Sense Hat | |
# | |
while true | |
do | |
ps axleww | openssl sha512 > /dev/fb1 | |
sleep 1 | |
done |