Answers for "lm35 arduino code"

1

lm35 arduino code

// LM35 ARDUINO CODE BY ZOUARI MEHDI
// 2022 
int val;
const int tempPin = A0; // Temp sensor connected to analog pin A0

void setup()
{
  Serial.begin(9600);
}
void loop()
{
  val = analogRead(tempPin);
  float temperature = ( val/1024.0)*500;
  Serial.print("temperature=");
  Serial.print(temperature);
  Serial.print("*C");
  Serial.println();
  delay(1000);
}
Posted by: Guest on April-15-2022

Browse Popular Code Answers by Language