Write an Arduino (sketch) program to:
- Read the value from the analog pin A0.
Use a While Loop in the program such that:
- While the analog value read at pin A0 is greater than a threshold of 700, then:
- turn ON the external LED at pin 7 and turn OFF the onboard LED connected to pin 13 for 5000 ms
- turn OFF the external LED at pin 7 and turn ON the onboard LED connected to pin 13 for 1000 ms
- Otherwise:
- turn OFF the external LED at pin 7 and turn ON the onboard LED connected to pin 13 for 5000 ms
- turn ON the external LED at pin 7 and turn OFF the onboard LED connected to pin 13 for 1000 ms
Make sure to compile your Arduino (sketch) on your Arduino IDE to correct any errors in the code. Copy and paste your code in the space provided.