Skip to content

Instantly share code, notes, and snippets.

View extrasleepy's full-sized avatar

Andrew Kleindolph extrasleepy

View GitHub Profile
// 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?
import json
import requests
from requests import get
app_id = 'your id'
app_key = 'your app key'
url = 'https://api.edamam.com/api/recipes/v2?type=public&q=chicken&app_id='+app_id+'&app_key='+app_key+'&cuisineType=American'
one_food = get(url).json()
print (one_food['hits'][0]['recipe']['label'])
import time
import board
import ssl
import socketpool
import wifi
import microcontroller
import adafruit_minimqtt.adafruit_minimqtt as MQTT
import adafruit_ahtx0
from adafruit_seesaw.seesaw import Seesaw