/*
* Test Program for LM35DZ
*/
#define A_inPin A0 // アナログ入力ピン番号
float A_val; //
アナログ入力値
float tempC = 0; // 摂氏値( ℃ )
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
A_val = analogRead( A_inPin );
Serial.print(A_val);
Serial.print("-");
tempC = ((5.0 * A_val) / 1024.0) * 100.0;
Serial.print( tempC );
Serial.println(" ");
delay(1000);
}
|