Since Rusty has been on a hydrolyzed diet, we've had to keep careful track of food reintroductions and any reactions he has to them, like vomiting or itching, in order to try and pinpoint a possible allergy. I created Rusty's Food Log using object-oriented programming in Python to get some practice with classes. Here is my code on Github, as well as the text file the program writes to!
I wanted to show everyone my little project I made tonight, 2/1/25. I made "Rusty's Magic 8 Ball" using my Raspberry Pi5 and a Sense HAT. The Sense HAT sits on top of the Raspberry Pi and has an 8x8 LED matrix that you can program to display pictures or text. I used Python for this project.
Here's my code, which you can also see on Github.
#this is a project for rusty's magic 8 ball for the sense hat!
from sense_hat import SenseHat
import random
sense = SenseHat()
purple = (160,32,240)
red = (255,0,0)
orange = (255,69,0)
yellow = (255,215,0)
green = (0,255,0)
blue = (0,191,255)
pink = (255,20,147)
w = (255,255,255)
b = (0,0,0)
possiblemessages = ["I will allow it.", "Try again after my nap.", "Sounds like you need a snack!", "That sounds like a you problem.", "Only if it involves treats!", "Sounds purrfect.", "All signs point to: nap!", "Outlook fuzzy, like my belly.", "I'm busy loafing.", "Hiss-terically unlikely.", "The stars align!", "Pawsitively!", "You'll land on your feet!", "Go for it!", "No doubts, only purrs!"]
rainbow = [red,orange,yellow,green,blue,purple,pink]
sense.show_message("Welcome to Rusty's Magic 8 Ball!", text_colour = purple, scroll_speed = .08)
sense.show_message("Shake to see what Rusty has to say!",text_colour = pink, scroll_speed = .08)
while True:
messagenumber = random.randint(0,14)
randomcolor = random.randint(0,6)
acceleration = sense.get_accelerometer_raw()
x = acceleration['x']
y = acceleration['y']
z = acceleration['z']
x = abs(x)
y = abs(y)
z = abs(z)
if x > 3 or y > 3 or z > 3:
sense.show_message(possiblemessages[messagenumber], scroll_speed = .08, text_colour = rainbow[randomcolor])
continue
else:
sense.clear()
The Sense HAT has an accelerometer, along with a gyroscope, a pressure sensor, a magnetometer, and temperature and humidity sensors. Using those capabilities along with the Sense HAT library, you can do all sorts of cool things! I created a list of colors using RGB values and a list of messages. The Sense HAT displays a welcome message and instructs the user to shake for a message, much like a Magic 8 Ball. The program captures info from the accelerometer to detect when the user shakes the Pi, then displays a random message in a random color. There's a possibility one could get the same message twice in a row (I'm not going to get into the mechanics of random number generators here lol). You can shake as many times as you want because the program loops back around every time.
The welcome message.
Example of some messages you can get. Notice a message is displayed twice in a row- the message is still picked "randomly," it just happened to pick this one again.
One of the projects I really want to try to implement is a Raspberry Pi-powered kitty cam, much like this one. I think it would be super cute and fun to capture Rusty doing different activities!
I plan on trying out Advent of Code this year in Python as a way of building my puzzle/problem-solving skills!
Check out my code here!
Okay, so I've gotten extremely behind on this (pretty much right away), so I may or may not be able to complete a ton! (Don't judge me.)
During Hacktoberfest 2024, I contributed to open-source projects by submitting pull requests, improving documentation, and fixing bugs. It was a rewarding experience that enhanced my collaboration and coding skills.
Check out my contributions on GitHub:
This very website you're exploring is one of my projects! Built using HTML, CSS, and JavaScript, it's designed to showcase my work, skills, and of course, my cat Rusty. Feel free to browse around and check out my creations.
In this choose-your-own-adventure game, Rusty the cat explores a world filled with mysteries and puzzles. Players can guide Rusty through different locations, make choices, and battle characters. Developed using Python, this game features classes for monsters and various combat mechanics. This is an ongoing project!
Click here to view the code: