Shop OBEX P1 Docs P2 Docs Learn Events
1-wire again — Parallax Forums

1-wire again

Lars50Lars50 Posts: 23
edited 2004-10-12 18:44 in BASIC Stamp
Hi all

Dispite advice to move away from the DS2405 I just need to check and see if somebody could give some comment to the code below.

The purpose is to make sure that all switches goes high·after a restart.

In my mind this code is working but in my view I think I should be able to detect the status without toggle the switch.

Any code improvement suggestions.

SETLOW:······························································
OWOUT OWpin, OW_FERst, [noparse][[/noparse]MatchROM, STR Switch1\8]·' toggle to learn status
OWIN OWpin, OW_BitMode + OW_BERst, [noparse][[/noparse]status]·········· ' learn status
·IF (Status = off)·· THEN OWOUT OWpin, OW_FERst, [noparse][[/noparse]MatchROM, STR Switch1\8] 'toggle if nessesary

Thanks Lars
Sign In or Register to comment.