#include #include "SoftwareSerial.h" SoftwareSerial bluetooth(0, 1); //TX, RX (Bluetooth) OneWire ds(2); byte adrT1[8] = {0x28, 0xFF, 0xB1, 0xF8, 0x01, 0x15, 0x03, 0xFD}; float celsius = 2; void setup() { ds.reset_search(); bluetooth.begin(9600); //Serial.begin(9600); } void loop() { letemp(); bluetooth.println(celsius); delay(500); } void letemp () { byte i; byte present = 0; byte data[12]; char cc1[20]; ds.reset(); ds.select(adrT1); ds.write(0x44, 1); // start conversion, with parasite power on at the end delay(1000); // maybe 750ms is enough, maybe not ds.reset(); ds.select(adrT1); ds.write(0xBE); // Read Scratchpad for (i = 0; i < 9; i++) data[i] = ds.read(); celsius = ((data[1] << 8) + data[0]) * 0.0625; //Serial.println(celsius); }