analogRead homework

 

 

It’s a bit messy but the code works with cases as well.