To sense temperature using the LM35 sensor connected to the Arduino board, perform the following steps:
- Invoke the Arduino IDE. Arduino will open up with a file showing its default content, as follows:
void setup() {// put your setup code here, to run once:}void loop() {// put your main code here, to run repeatedly:}
- Connect the Arduino board to the PC.
- From the Tools menu, select Port and confirm whether it shows COM3 (Arduino/Genuino Uno) or whatever Arduino board you have attached to your PC. Additionally, confirm whether the Board option from the Tools menu indicates the Arduino board that is attached to your PC. In my case, the Board option will show Arduino/Genuino Uno.
- Type the following program into the editor window: ...