Project 1
Project 1 Explanation video
Originally I wanted this project to be a peaceful noise and was leaning more towards a white noise machine. I changed my mind last week when I was overloaded with homework and my anxiety was through the roof about it. Personally, I can't sleep when I know I have things that need to be finished so I moldeled my Arduino after what I feel at night while trying to rest knowing I have homework. I chose to make it look like a cloud to represent me trying to relax but it makes a loud alarm sound which represents my mind racing and not letting me get any rest.
​
CODE:
int ledPin = 13;
int buzzerPin = 12;
int ldrPin = A0;
void setup() {
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
pinMode(buzzerPin, OUTPUT);
pinMode(ldrPin, INPUT);
}
void loop() {
int ldrStatus = analogRead(ldrPin);
if (ldrStatus <= 400) {
tone(buzzerPin, 100);
digitalWrite(ledPin, HIGH);
delay(100);
noTone(buzzerPin);
digitalWrite(ledPin, LOW);
delay(100);
Serial.println("HOMEWORK");
}
else {
noTone(buzzerPin);
digitalWrite(ledPin, LOW);
Serial.println("slightly less homework");
}
}
![]() | ![]() | ![]() | ![]() |
---|