Kaluma library for LM35 temperature sensor.
Here is a wiring example for ADC0.
| Raspberry Pi Pico | LM35 |
|---|---|
| VBUS (5V) | VCC |
| GND | GND |
| GP26 (ADC0) | OUT |
npm install https://github.com/niklauslee/lm35Here is an example code for reading temperature (in celsius) from LM35.
const lm35 = require('lm35');
const pin = 26; // ADC0
setInterval(() => {
console.log(`temperature (in celsius): ${lm35.read(pin)}`);
}, 1000);pin<number>Pin number supporting ADC.- Returns:
<number>
Reads voltage from the pin and returns temperature value in celsius.
