mmm, i think i may have spotted few problems...
When you declare an array like this...
it will hold 3 different value. And they will be...
Array[0]
Array[1]
Array[2]
Not MUCH, if you Write to Array[3], the compiler won't complaint... but it will cause you some problem one day or another because you WILL overwrite x variable...
so just modify your code and it should work better. In VB it work.. but it's a little bit different in PBP.
Just for testing, try...
Code:
DelayArray var byte[4]
delayarray[0]=1
delayarray[1]=10
delayarray[2]=100
delayarray[3]=200
Delay var word
CounterA var byte
Start:
for countera=0 to 3
high PORTB.0
delay=delayarray[countera]
pause delay
low PORTB.0
pause delay
next
goto start
at least it's working here
Last edited by mister_e; - 31st December 2006 at 14:07.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks