Just started today to look at the firewing and shield.
I'm afraid my coding is at a novice level.
What do I need to add to the proglcdplus program to add a couple of extra DS18B20?
OW.Search()
Sub OnDeviceFound(command As Byte, family As Byte, ByRef romID() As Byte, ByRef abort As Boolean) Handles OW.OnSearch
If command = owSearchROM And family = DS18B20.Family Then
DS18B20_Available = True ' mark as available
DS18B20.ROMID = romID ' set the unique ROM id...
abort = True ' no more searching required
End If
End Sub
DS18B20.ROMID = romID
dim romID() as byte = {&H28, &HDE, &H7E, &H59, &H04, &H00, &H00, &HD3}
DS18B20.RomID = RomID
' one wire, used for search
Imports OW
' the event is triggered each time the OW module is asked to
' perform a search - here we will list all devices connected to
' the one wire bus...
Sub OnDeviceFound(command As Byte, family As Byte, ByRef romID() As Byte, ByRef abort As Boolean) Handles OW.OnSearch
' display family...
Console.Write("&H", Hex(family,2)," : ")
' display unique identifier...
for index as byte = 0 to ubound(romID)
Console.Write("&H", Hex(romID(index),2)," ")
next
Console.Write(13,10)
End Sub
' display a list of all devices connected to the bus...
sub Main()
OW.Search()
end sub
&H28 : &H28 &HDE &H7E &H59 &H04 &H00 &H00 &HD3
dim tempWhole as sbyte
dim tempFrac as ushort
DS18B20.GetTemp(tempWhole, tempFrac)
dim theTemp as ushort = DS18B20.ReadTemp()
Users browsing this forum: No registered users and 1 guest