Concept
For this week’s assignment, I worked on building a Study Tracker that turns study and rest into clear, color-coded cues so I can keep my attention steady. The buttons each control one of the LED’s, making them flash when pressed then stop again signaling study and break depending on the button pressed. The LED flashing means the student is in a break and the blue LED flashing means the student is focused. While the the dial to set the brightness so the lights fit the time period of the studying, softer at night and stronger during the day. Over time the repeated pairing of blue with study and red with rest builds a simple habit, so the colors start to set the mood before a student begins studying.
Demonstration
Code Snipped
//Map potentiometer to brightness
int potValue = analogRead(potPin);
int brightness = map(potValue, 0, 1023, 0, 255);
//Button 1
bool button1State = digitalRead(button1Pin);
if (button1State == LOW && lastButton1State == HIGH) {
led1Flashing = !led1Flashing;
if (!led1Flashing) {
analogWrite(led1Pin, brightness);
}
delay(200);
}
lastButton1State = button1State;
//Button 2
bool button2State = digitalRead(button2Pin);
if (button2State == LOW && lastButton2State == HIGH) {
led2Flashing = !led2Flashing;
if (!led2Flashing) {
analogWrite(led2Pin, brightness);
}
delay(200);
}
lastButton2State = button2State;
Brining together the different elements we learnt in class, I believe that this part of the code to me was exploring how there are countless ways to combine techniques and create something new. Which reminded me of this week’s reading which discussed the value of building up on existing works rather than worrying about creating something did not exist before. Creating something functional and different from the simple parts given to us is possible.
Complete Code
Schematic
During this assignment, exploring both digital and analog input, was interesting in discovering how they can interact together to add depth and dimension to the work. The difficult part to me was coming up with a way to creatively merge both of these elements while not having them crash with each other. In future work, I’d like to explore more sensors and switches and integrate them into my work, there were several ones we dicussed in class that I would like to explore.
