รายละเอียด
IC DS18B20
ไอซี DS18B20
ไอซีวัดอุณหภูมิ
โค๊ดตัวอย่าง
-
#include <OneWire.h> -
#include <DallasTemperature.h>
-
-
// Define the pin connected to the DS18B20 sensor
-
#define ONE_WIRE_BUS 2
-
-
// Setup a oneWire instance to communicate with any OneWire devices
-
OneWire oneWire(ONE_WIRE_BUS);
-
-
// Pass the oneWire reference to DallasTemperature library
-
DallasTemperature sensors(&oneWire);
-
-
void setup() {
-
// Start serial communication
-
Serial.begin(9600);
-
-
// Initialize the DS18B20 sensor
-
sensors.begin();
-
}
-
-
void loop() {
-
// Call sensors.requestTemperatures() to issue a global temperature
-
// request to all connected devices on the bus
-
sensors.requestTemperatures();
-
-
// Read the temperature from the DS18B20 sensor
-
float temperatureC = sensors.getTempCByIndex(0);
-
-
// Print the temperature to the serial monitor
-
Serial.print("Temperature: ");
-
Serial.print(temperatureC);
-
Serial.println("°C");
-
-
// Wait for a second before taking the next temperature reading
-
delay(1000);
-
}
-
ขาย DS18B20 ราคา 24.00 บาท ในไทย
24.00 บาท
- จำนวนสินค้า: 22
- รุ่น: IC DS18B20
- น้ำหนัก: 0.21g
- SKU: 484
Product Views: 2409
สินค้าที่เกี่ยวข้อง
ESP8266 Node MCU WIFI V3 CH340
หน่วยความจำ 4M
ดาวน์โหลด (Downlod) Driver USB TO Serial CH340G สำหรับ Windows 7
ดาวน์โหลด (Downlod) Driver ..
120.00 บาท
Wireless module NodeMcu ESP8266 ESP-12E
CP2102
Wireless module NodeMcu 4M bytes Lua WIFI Internet of Things development board based ESP8266 ES..
150.00 บาท
Adapter 110-220VAC TO 5VDC 2.5A Micro USB
- แรงดัน 5V
- กระแส 2.5A
- สายไฟ micro usb
- สำหรับ raspberry PI , Orange PI , ESP8266..
100.00 บาท
ที่ดูดไอซี SMD สูญญากาศ..
50.00 บาท
ถาดเก็บ น็อต อะลูมิเนียม มีแถบแม่เหล็ก
With a magnetic screw plate has a certain weak magnetic, you can attract the screw to prevent the loss of s..
120.00 บาท