Monday, 22 August 2016

Lesson 7 : Activity 1 (Temperature Sensor)

Lesson 7
Activity 1 - Temperature Sensor

Materials Needed:
·         1 X Arduino board
·         1 X Breadboard
·         1 X USB
·         1 X Temperature Sensor; TMP36
·         5 X Jumper Wires


Codes:

int analogVal;
const int tempPin = ;
� voltage;
float temperature;

void setup()
{ 
 pinMode (tempPin, ); 
 Serial.begin(9600);
}
void loop()
{
  analogVal=analogRead(tempPin); 
 voltage = (analogVal/1024.0)*5.0;  
temperature = 100*voltage-50;     
  Serial.println(temperature); 
 (200);
}

*Please fill in the blanks in the Arduino sketch.

No comments:

Post a Comment