#include /* LM35 analog temperature sensor with Arduino example code. More info: https://www.makerguides.com */ // Define to which pin of the Arduino the output of the LM35 is connected: #define sensorPin 2 const int RX = 0; const int TX = 0; SoftwareSerial Serial(TX,RX); void setup() { // Begin serial communication at a baud rate of 9600: pinMode(sensorPin, INPUT); Serial.begin(9600); } void loop() { // Get a reading from the temperature sensor: int reading = analogRead(sensorPin); // Convert the reading into voltage: float voltage = reading * (5000 / 1024.0); // Convert the voltage into the temperature in degree Celsius: float temperature = voltage / 10; // Print the temperature in the Serial Monitor: Serial.print(temperature); Serial.print(" \xC2\xB0"); // shows degree symbol Serial.println("C"); //Serial.write(temperature); }