The temperature sensor

thermometerThe getTemperature method returns the current temperature at the temperature probe

public double getTemperature()
The value returned is in Celsius.
To get Fahrenheit from Celsius, multiply the number by 1.8 and then add 32.

Notice where the temperature probe is located
sensors

Type in this program to use the temperature probe as a meter to determine the current temperature in the room in Fahrenheit and how it varies under the following conditions:

  1. If the finch is in the light or in the shade
  2. If you are touching the temperature sensor
  3. How high or low can you get the temperature to rise or drop?

temperature code

Challenge:

Modify the program to use 2 variables.
One for the temperature now and one for the initial temperature when the program starts (before the loop)

Set the Finch's beak to blue at the beginning (before the loop)
Read the temperature and store it so you have something to compare to

In the loop, if the Finch senses a temperature of 2 degrees higher than the initial temperature, change the beak to red for 2 seconds.

Make the robot buzz twice and end the program when the Finch is no longer level. (notice this is the same loop as the example program above)