Skip to content

Instantly share code, notes, and snippets.

View extrasleepy's full-sized avatar

Andrew Kleindolph extrasleepy

View GitHub Profile
from gpiozero import Button, LED
from signal import pause
import time
# Define button on GPIO pin 19
button = Button(19)
# Define LED/light on a GPIO pin (change pin number as needed)
led = LED(17) # Change 17 to your actual LED pin number
from gpiozero import Button, LED
from signal import pause
import time
# Define button on GPIO pin 19 and LED on GPIO pin 17
button = Button(19)
led = LED(17) # Change this pin number to match your LED connection
# Counter to track which state we're in (0, 1, or 2)
state = 0
// Define pins for the LEDs
#define LED_PIN0 0
#define LED_PIN1 1
void setup() {
pinMode(LED_PIN0, OUTPUT);
pinMode(LED_PIN1, OUTPUT);
}
// the setup function runs once when you press reset or power the board
void setup() {
// initialize built in LED pin as an output.
pinMode(LED_BUILTIN, OUTPUT);
// initialize USB serial converter so we have a port created
Serial.begin();
}
// the loop function runs over and over again forever
void loop() {
//unknown days
//AKleindolph 2025 (with ChatGPT)
#include <avr/sleep.h>
#include <avr/wdt.h>
// Define pins for the LEDs
#define LED_PIN0 0
#define LED_PIN1 1
@extrasleepy
extrasleepy / ATtiny_test.ino
Created December 5, 2024 18:22
ATtiny_test.ino
// the setup function runs once when you press reset or power the board
void setup() {
pinMode(0, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(0, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait
digitalWrite(0, LOW); // turn the LED off by making the voltage LOW
# Hide the cursor
pygame.mouse.set_visible(False)
import pygame
import sys
# Initialize Pygame
pygame.init()
# Set display resolution
screen_width = 1024 # Change this to your screen's width
screen_height = 600 # Change this to your screen's height
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
elif event.type == pygame.KEYDOWN and event.key == pygame.K_ESCAPE:
running = False
@extrasleepy
extrasleepy / hint.py
Last active September 7, 2023 22:42
hint.py
import datetime
import pytz
def currentTime(timezone):
try:
#what goes here?
return #what goes here?
except:
return #what goes here?