I tried at least ten different ways to code this...I won't include the 'bad code' for readability purposes, but some of the things I tried include:
-Using a variable to trigger an event if less than x minutes had passed and an event if more than x minutes had passed. The light would gradually become more or less intense depending on each event's conditions.
-Using void functions to kick off the next series of actions expected
-Creating one big nested if function
-Many more approaches which all did not work
After struggling to understand why my attempts were not working, I realized I needed to spend time learning how to properly debug the code. I then spent A LOT of time learning how to use Serial.print and the command prompt to trace where the code was working and where it was not. After some time fine-tuning the code, I was able to come up with a way to 'mostly' get the program to work. Admittedly, this code could be optimized, but it's a LONG WAY from where I started.
Content Rating
Is this a good/useful/informative piece of content to include in the project? Have your say!
You must login before you can post a comment. .