Please write the program in Arduino.



???????
Figure 1: Temperature Measurement and Indicator Circuit
Write a program to switch between the indicator mode and temperature measurement mode upon the change of position of the slide switch. In temperature, measurement mode measures the ambient temperature and indicates if the temperature is less than the specified value by LED indication. In indicator, mode blink LED at a steady interval.
Temperature measurement mode Measure the ambient temperature using the thermistor connected to the analog pin. Convert the measured thermistor resistance " \( \mathbf{R} \) " to temperature value "T" using Equation 1. If the measured temperature is less than or equal to \( 25^{\circ} \mathrm{C} \), blink the LED at \( 0.4 \mathrm{~s} \) intervals. If the measured value is over \( 25^{\circ} \mathrm{C} \), keep the LED ON. This process should be continuous with a delay of \( 0.4 \mathrm{~s} \). \[ T=\left(\frac{1}{A+B(\ln R)+C(\ln R)^{2}+D(\ln R)^{3}}\right)-273.15 \] Where, \( \mathrm{A}=1.181 \mathrm{e}-3, \mathrm{~B}=2.169 \mathrm{e}-4, \mathrm{C}=1.901 \mathrm{e}-6, \mathrm{D}=1.832 \mathrm{e}-8 \). After every temperature measurement, report the following to the serial monitor with a tab separation: - Program Mode - Time at measurement in milliseconds - Measure ADC Value - Voltage out of voltage divider with 2 digits of precision - Resistance measured with 1 digit of precision - 'Temperature measured with 2 digits of precision Indicator mode In indicator mode, make the LED blink at a frequency of \( 0.4 \mathrm{~Hz} \) and duty cycle of \( 60 \% \). The frequency and duty cycle are related to the time the LED stays active and is given by Equations 2 and 3 , where "F" is Frequency, "D" is Duty Cycle, "TH" is 'Time High, and "TL" is 'Time Low. \[ \begin{array}{c} F=\frac{1}{T H+T L} \\ D=\frac{T H}{T H+T L} \times 100 \end{array} \]
Hints for the program: Comments: Use comments throughout for anyone to follow your code. Constants: Define constants for hardware pins used in this program. Define constants to record time, temperature, and any intermediate conversions. Setup: Enable serial communication between Arduino and the computer. Define pinMode of the hardware pins used in the program. Loop: Inside the loop. - Use millis() to keep track of time. - Convert the measured \( \mathrm{ADC} \) value to temperature and store all the conversion variables. - Use \( \log (x) \) for math operation \( \mathbf{L N}(\mathbf{x}) \). - Use pow \( (x, y) \) for math operation \( x^{y} \). - Use Serial.print() for in-line text, Serial.print("\t") for tab spacing and Serial.println() for in-line text, and indicating end-of-line for sending messages to the serial monitor.