เมนู
สินค้าในตระกร้า

ขาย DS18B20 ราคา 24.00 บาท ในไทย

ขาย DS18B20 ราคา 24.00 บาท ในไทย

รายละเอียด

IC DS18B20

ไอซี DS18B20

ไอซีวัดอุณหภูมิ

โค๊ดตัวอย่าง


  1. #include <OneWire.h>
  2. #include <DallasTemperature.h>
  3.  
  4. // Define the pin connected to the DS18B20 sensor
  5. #define ONE_WIRE_BUS 2
  6.  
  7. // Setup a oneWire instance to communicate with any OneWire devices
  8. OneWire oneWire(ONE_WIRE_BUS);
  9.  
  10. // Pass the oneWire reference to DallasTemperature library
  11. DallasTemperature sensors(&oneWire);
  12.  
  13. void setup() {
  14. // Start serial communication
  15. Serial.begin(9600);
  16.  
  17. // Initialize the DS18B20 sensor
  18. sensors.begin();
  19. }
  20.  
  21. void loop() {
  22. // Call sensors.requestTemperatures() to issue a global temperature
  23. // request to all connected devices on the bus
  24. sensors.requestTemperatures();
  25.  
  26. // Read the temperature from the DS18B20 sensor
  27. float temperatureC = sensors.getTempCByIndex(0);
  28.  
  29. // Print the temperature to the serial monitor
  30. Serial.print("Temperature: ");
  31. Serial.print(temperatureC);
  32. Serial.println("°C");
  33.  
  34. // Wait for a second before taking the next temperature reading
  35. delay(1000);
  36. }
  37.  
ขาย 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 บาท
Adapter 110-220VAC TO 5VDC 2.5A Micro USB - แรงดัน 5V - กระแส 2.5A - สายไฟ micro usb  - สำหรับ raspberry PI , Orange PI , ESP8266..
100.00 บาท
ถาดเก็บ น็อต อะลูมิเนียม มีแถบแม่เหล็ก With a magnetic screw plate has a certain weak magnetic, you can attract the screw to prevent the loss of s..
120.00 บาท