Working library is available here: https://www.b4x.com/android/forum/threads/onewire-dallas-1-wire-protocol.66672/
rWireOne library wraps the following libraries:
https://github.com/milesburton/Arduino-Temperature-Control-Library
http://www.pjrc.com/teensy/td_libs_OneWire.html
It allows reading the temperature from one wire temperature sensors (see the first link for more details).
This is a beta version.
rWireOne library wraps the following libraries:
https://github.com/milesburton/Arduino-Temperature-Control-Library
http://www.pjrc.com/teensy/td_libs_OneWire.html
It allows reading the temperature from one wire temperature sensors (see the first link for more details).
This is a beta version.
B4X:
Sub Process_Globals
Public Serial1 As Serial
Private deviceAddress() As Byte = Array As Byte(0x28, 0xFF, 0x5E, 0x18, 0x04, 0x15, 0x03, 0x34)
Private dt As DallasTemperature
Private timer1 As Timer
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
dt.Initialize(3)
dt.SetResolution(deviceAddress, 10)
timer1.Initialize("timer1_Tick", 250)
timer1.Enabled = True
End Sub
Sub Timer1_Tick
dt.RequestTemperatures
Dim tempC As Double = dt.GetTempC(deviceAddress)
If tempC = -127 Then
Log("Error getting temperature.")
Log(dt.ToFahrenheit(tempC))
Log(dt.ToCelsius(dt.ToFahrenheit(tempC)))
Else
Log("Temperature: C: ", tempC, ", F: ", dt.ToFahrenheit(tempC))
End If
End Sub
Last edited: