OWSearch

SwordfishUser.OWSearch History

Hide minor edits - Show changes to markup

March 07, 2008, at 05:01 PM by David Barker -
Changed lines 34-35 from:

Output

to:

Sample Output

March 07, 2008, at 05:00 PM by David Barker -
Changed lines 32-44 from:

=]

to:

=]

Output

 FAMILY $28 ($1D) ($0000002CDBAE) <- DS18B20
 FAMILY $28 ($3F) ($0000002CD16E) <- DS18B20
 FAMILY $05 ($F1) ($00000019F75D)
 FAMILY $05 ($90) ($0000001A20B7)
 FAMILY $23 ($CA) ($0000005C62EE)
 5 device(s) found
March 07, 2008, at 04:59 PM by David Barker -
Added lines 1-32:
Device = 18F452
Clock = 20

// import modules...
Include "ow.bas"
Include "convert.bas"
Include "usart.bas"

// on find event handler...
Event OnFind()
   Dim Index As Byte
   USART.Write("FAMILY $", HexToStr(SearchFamily,2))
   USART.Write(" ($",HexToStr(SearchID(7),2),")")
   USART.Write(" ($")
   Index = 6
   Repeat
      USART.Write(HexToStr(SearchID(Index),2))
      Dec(Index)
   Until Index = 0
   USART.Write(")",13,10)
End Event

// working variables...
Dim DeviceCount As Byte   

// program start...
SetBaudrate(br19200)
SetPin(PORTC.0)
DeviceCount = Search(owSearchROM, OnFind)
USART.Write(DecToStr(DeviceCount), " device(s) found", 13, 10)