pike
Member
hey guys,
I tried making a binary counter to learn how to write and program PIC's a few weeks ago. I'm using PIC Basic Plus to compile these codes. Unsuccesful, I left it alone for a little while to cool down my temper...
Now that i've come back to give it another go, i'm still stuck!!! This is my code:
Initial:
poke trisb, 0 'set port b to output
poke portb, 0 'turn off all connected leds
Bincount:
for b0 = 0 to 255
poke portb, b0 'write the value of b0 into the register
next b0 'increase the value by 1
goto bincount 'keep repeating
end
The problem is that it won't let me compile the code it says:
Error at Line [7] In file [test.bas] *** Misplaced or Incorrect 'NEXT' command! ***
Whats wrong with the code???
I tried making a binary counter to learn how to write and program PIC's a few weeks ago. I'm using PIC Basic Plus to compile these codes. Unsuccesful, I left it alone for a little while to cool down my temper...
Now that i've come back to give it another go, i'm still stuck!!! This is my code:
Initial:
poke trisb, 0 'set port b to output
poke portb, 0 'turn off all connected leds
Bincount:
for b0 = 0 to 255
poke portb, b0 'write the value of b0 into the register
next b0 'increase the value by 1
goto bincount 'keep repeating
end
The problem is that it won't let me compile the code it says:
Error at Line [7] In file [test.bas] *** Misplaced or Incorrect 'NEXT' command! ***
Whats wrong with the code???