I agree, good stuff!
Here's another one.Then, here's a test loop to cycle thru the relays...Code:INCLUDE "VirtualPort.bas" Relays VAR BYTE : Relays = 0 ASM RelayPort macro Vpin 0, PORTB, 6 ; RELAY1 Vpin 1, PORTC, 4 ; RELAY2 Vpin 2, PORTD, 2 ; RELAY3 endm OutputPort RelayPort ; Set Port to OUTPUT ENDASMCode size = 104 words, 65 without the PAUSE.Code:i VAR BYTE Main: for i = 0 to 2 Relays = DCD i @ WritePort _Relays, RelayPort PAUSE 500 next i Goto Main
or you can just...to turn on RELAY2 by itself.Code:Relays = %010 @ WritePort _Relays, RelayPort
Code size = 21 words.
http://www.pbpgroup.com/Vport/VirtualPort.bas.txt
HTH,
DT




Bookmarks