Sorry, it should be getTemp() - Firewing modules are open source, so you can use the explorer window to see what public variables, subs and functions are available and also open the module in the editor window to see how it all works...
Sub Main()
Dogm.Clear
Dogm.SetBacklight(512)
OW.Search()
Console.Write(13,10)
Console.Write("Devices found : ",Str(devices))
dogm.WriteAt(1,1,"Found : ",Str(devices))
End Sub
romID1 : &H28 &HDE &H7E &H59 &H04 &H00 &H00 &HD3
romID2 : &H05 &H5D &HF7 &H19 &H00 &H00 &H00 &HF1
Devices found : 2
' import modules...
Imports DS18B20 ' temperature sensor module
Imports OW ' one wire, used for search
' OW rom structure...
structure OwRomId
romID(8) as byte
family as byte
end structure
' program constants and variables...
const MAX_ROM = 8 ' max number of likely Ow devices
dim owDevices(MAX_ROM) as OwRomId ' array of rom ids
dim deviceCount as byte = 0 ' number of devices
' device found event...
Sub OnDeviceFound(command As Byte, family As Byte, ByRef romID() As Byte, ByRef abort As Boolean) Handles OW.OnSearch
owDevices(deviceCount).romID = romID ' save rom ID
owDevices(deviceCount).family = family ' save family
deviceCount += 1 ' next
End Sub
' main program entry point...
Sub Main()
OW.Search()
Console.Write("Devices found : ",CStr(deviceCount),13,10)
for deviceIndex as byte = 0 to deviceCount - 1
for index as byte = 0 to ubound(Ow.RomID)
Console.Write("&H", Hex(owDevices(deviceIndex).RomId(index),2)," ")
next
console.write(13,10)
next
End Sub
Devices found : 2
&H28 &HDE &H7E &H59 &H04 &H00 &H00 &HD3
&H05 &H5D &HF7 &H19 &H00 &H00 &H00 &HF1
Users browsing this forum: No registered users and 0 guests