Welcome aboard!
I'm not sure what you want to accomplish. Do you want to make 2 LEDs blink one after another, you just turn the LEDs ON/OFF directly:
- PIC wired as in PBP manual (section 2.4 in v2.60).
- have one LED on pin B0 as in example.
- have another just like it on pin B1.
- configure your particular PIC properly.
- define proper oscillator and then do this:
Code:
TRISB = %00000000 ' set all Port B pins as output
LED1 = PortB.0 ' assign LEDs to Port B
LED2 = PortB.1
LOOP:
LED1 = 1 ' turn ON LED 1
LED2 = 0 ' turn OFF LED 2
PAUSE 100 ' wait a bit so the human eye can catch the blink
LED1 = 0 ' alternate the LEDs
LED2 = 1
PAUSE 100
GOTO LOOP ' start over
If you use Port A, there may be other considerations in the configs (section 2.5.1).
This is off the top of my head. It's not written for optimization, it's written so you can understand easily what is happening.
If you dig around in your PBP folder, you will find sample programs. I'm not on my programming PC so I can't tell you exactly where. There is a BLINKY example in there already.
Robert

EDIT: I don't get it, code comments used to line up properly before....
Bookmarks