I haven't tried it on the 16F1's, but I think it should work.Code:LEDs VAR WORD ;--------------------------------------------------------------------------- INCLUDE "VirtualPort.bas" ASM MyPortPins macro ; these define which bits go with which pins Vpin 0, PORTC,6 Vpin 1, PORTB,6 Vpin 2, PORTB,5 Vpin 3, PORTB,4 Vpin 4, PORTC,2 Vpin 5, PORTC,1 Vpin 6, PORTC,0 Vpin 7, PORTA,2 Vpin 8, PORTA,1 endm ENDASM ;--------------------------------------------------------------------------- Init: @ OutputPort MyPortPins ; Set Pins to Output LEDs = %000010011 @ WritePort _LEDs, MyPortPins PAUSE 1000 LEDs = 0 ;--------------------------------------------------------------------------- Main: LEDs = LEDs + 1 @ WritePort _LEDs, MyPortPins ; write pattern to Virtual Port PAUSE 250 GOTO Main
The VirtualPort.bas file is in this thread ... http://www.picbasic.co.uk/forum/show...3158#post83158
Like 80% of everything I've done in this forum, the post got destroyed. But the file's still there.




Bookmarks