https://github.com/niklauslee/lm35
Kaluma library for LM35 temperature sensor
https://github.com/niklauslee/lm35
kaluma lm35 sensor temperature
Last synced: 2 months ago
JSON representation
Kaluma library for LM35 temperature sensor
- Host: GitHub
- URL: https://github.com/niklauslee/lm35
- Owner: niklauslee
- License: mit
- Created: 2022-02-17T04:05:24.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-02-17T04:57:55.000Z (over 3 years ago)
- Last Synced: 2025-01-21T17:30:42.405Z (4 months ago)
- Topics: kaluma, lm35, sensor, temperature
- Language: JavaScript
- Homepage:
- Size: 43.9 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LM35
Kaluma library for LM35 temperature sensor.
# Wiring
Here is a wiring example for `ADC0`.
| Raspberry Pi Pico | LM35 |
| ----------------- | ------- |
| VBUS (5V) | VCC |
| GND | GND |
| GP26 (ADC0) | OUT |
# Install
```sh
npm install https://github.com/niklauslee/lm35
```# Usage
Here is an example code for reading temperature (in celsius) from LM35.
```javascript
const lm35 = require('lm35');
const pin = 26; // ADC0setInterval(() => {
console.log(`temperature (in celsius): ${lm35.read(pin)}`);
}, 1000);
```# API
## read(pin)
- **`pin`** `` Pin number supporting ADC.
- **Returns**: ``Reads voltage from the pin and returns temperature value in celsius.