Consider circuit diagram and the program below.. Note:this two pictures of the circuit its shows the connections on one diagram,
Make use of the comments to complete the program by selecting the correct option to complete the missing or incomplete statements:
Let incomplete statements be
[..................]. (number)
so that you can see them while reading the code
// include the LCD library
[......................]. (1)
// create a variable for controlling brightness
int ledBrightness;
// create a variable for reading the switch value
int sPin = 12;
// this is the initializing of the lcd libray and interface pin
[..........................] .(2)
void setup()
{
// setup the lcd as a 16 character by 2 row display
[...........................] .(3)
// setup the switch pin to be an input
pinMode(sPin, INPUT);
}
void loop()
{
// refresh the LCD first row
lcd.setCursor(0,0);
lcd.print(" ");
// read the values coming from our sensor
int tempSens =
[.........................] .(4)
// converting that reading to voltage
float sensVolt = tempSens * 5;
sensVolt /= 1024;
// convert from 10 mv per degree with 500 mV offset to degrees ((voltage - 500mV) times 100)
float tempC =
[............................] .(5)
if(digitalRead(sPin) == LOW)
{
// print "Temp in Fahrenheit" in the first row of the display
[...........................] .(6)
lcd.print("Temp in Fahrenheit");
// convert to Fahrenheit
float tempF =
[............................] .(7)
// print the temp in degrees Fahrenheit Celcius second row of display
[.............................].(8)
lcd.print(String(tempF) + " deg F");
}
else
{
// print "Temp in Celcius" in the first row of the display
[..........................] .(9)
lcd.print("Temp in Celcius");
// print the temp in degrees Celcius second row of display
[..........................] .(10)
lcd.print(String(tempC) + " deg C");
}
// map the sensor value to brightness ,min is 0 and max is 255
[...........................] .(11)
// write the brightness value out to pin 11
analogWrite(11, ledBrightness);
delay(500);
}
Extracted text: 1J4J44 DIGITAL (PWM-) OO UNO ARDUINΟ THP POWER ANALOG IN HILL
Extracted text: TMP POWER ANALOG IN .....