Hi guys , not sure of how to do this correctly . what i want to do is assign ports i/o pins in to an array thought it this would work but no
the complete code complies ok with no errors ( yep !!!)
all pins have been setup as outputs
GPio.3 is always input
test on 12f683
why is the output not happening ??
Cheers
Sheldon
Code:
X VAR BYTE ' General loop count
T var byte ' loop Count for LED Array selection
Z Var Byte ' Loop Counter for 100 scan to flash power LED
Cycles var byte ' Number cycles per led
IR_D var byte[4] ' IR Diode array
Pulse_cnt Var byte ' Temp counter Number of pulses per LED
------- Setup port pins for IR Output ----------
PWR_LED var GPIO.0 ' PWR LED - 1 = ON ,0 = OFF
IR_D[1] = GPIO.1 ' IR LED 1 - 1 = ON ,0 = OFF
IR_D[2] = GPIO.2 ' IR LED 2
IR_D[3] = GPIO.4 ' IR LED 3
IR_D[4] = GPIO.5 ' IR LED 4
T = 1 ' Set T to point led 1
Pulse_cnt = 12 ' Set base pulse count cycles for IR lED ( IR LED 1 = 12 pulse , LED 2 = 14 pulses etc to 30 pulses
For T = 1 to 4 ' Select IR LED for Pulses
Cycles = 0 ' Set to 0
for Cycles = 1 to Pulse_cnt ' Each IR led increments the amount of pulses by 2 for IR LED ID use
IR_D[T] = 1 ' Set IR LED High
pauseus 100 ' Remain on for test uS
IR_D[T] = 0 ' Set IR LED Low
pauseus 200 ' remain off for testuS
next Cycles
Pulse_cnt = Pulse_cnt +2 ' increment pulse count by offset of 2 for each IR LED
pauseus 350 ' Wait 350us between pulse bursts and selecting next IR LED
Next T
Bookmarks