Posts

Showing posts from January, 2023

Stupid Pet Trick

Image
I've been invested in choose your own adventure-style games lately, where someone has to pick between two options. I've also been interested in working with light of some sort for quite some time now. I'd originally wanted to do something with programmable LED's (so I could have the full spectrum at my disposal), but I figure with a turn around of two weeks, I don't exactly have enough time to work out all the details of what I want to do with the colors. While making the code, I had to consider how I was going to make it more condensed, especially since morse code involves a lot of dashes and dots, which creates a lot of delays. I had to use a Boolean function, and I also had to create my own functions to represent each letter, which ended up being pretty understandable after the 4th letter or so. The last problem I ran into was the fact that the ring light I was using had a multi-function control switch (the power was made of one button) to turn it on afte

Interactive LED Circuit

Image
(Video link also here  https://vimeo.com/790609322  ) void setup() { Serial.begin(9600); pinMode(5, OUTPUT); pinMode(6, OUTPUT); pinMode(9, OUTPUT); pinMode(10, OUTPUT); pinMode(11, OUTPUT); //pushbutton pinMode(12,INPUT); digitalWrite(12,HIGH); } void loop() { //is button pressed? if(digitalRead(12)==0){ //red light with green turn signal digitalWrite(11,HIGH); digitalWrite(5,HIGH); digitalWrite(10,LOW); digitalWrite(9,LOW); digitalWrite(6,LOW); delay(2000); //red light with yellow turn signal digitalWrite(5,LOW); digitalWrite(11,HIGH); digitalWrite(6,HIGH); delay(1000); //just red digitalWrite(11,HIGH); digitalWrite(6,LOW); delay(1000); //green light digitalWrite(11,LOW); digitalWrite(6,LOW); digitalWrite(9,HIGH); delay(2000); //yellow light digitalWrite(9,LOW); digitalWrite(10,HIGH); delay(1000); } //if button isn't pressed, potentiometer controls which light is on else{ if(analogRead(A0)<200){ digitalWrite(5,HIGH); digitalWrite(6,LOW); digitalWrite(9,LOW); digitalW

Blink

Image
Last semester, I took MADT 304, which made me a bit familiar with the use of the Arduino. I have yet to make the circuit because I have not yet gotten my electronics kit, but I can show the coding that I've drafted up. I've kept it simple and left in notes for what each line of code is supposed to do. On a separate note, I have some videos left over from last semester where I played around with the blink function using 2 LED's. In one video, they switch back and forth between which one was blinking and in the second video, they both blinked in and out at the same time.