I'm trying to create a program for a microcontroller project. I've written most of the code but am stuck on how to get it to all function together. Essentially what I am doing is using a potentiometer, a photoresistor, 2 LED's, and a small piezoelectric speaker.
What i am doing is comparing voltage between PR and pots to control when sound will play and what LED will light up. I've written separate programming allowing the LED's to function as intended, but when i incorporate the void note function it will only allow either the idle LED to be on or for the alarm LED and speaker to play. I've used a if and else if statements. I can't figure out how to get it all to run smoothly. Any input would be much appreciated
P.S. This is a beginner Microcontroller class so everything is pretty basic.