quick question on letpins and simulator

hax

New Member
I have a seemingly simple program that doesn't work in the simulator:

main:
let pinsb=%11111111
pause 1000
let pinsb=%00000000
pause 1000
goto main

I would expect the b.0 to b.7 pins to go green but they don't. Individual pins can be addressed no problem however. It's my first time using the simulator. What am I doing wrong?
 

erco

Senior Member
I forget, with Picaxe do you need to specify the pins as outputs before using pinsb? Using either output or.dirs command. Or was that BASIC Stamp...?

Also try outpinsb, that may be sufficient.
 
Last edited:

marks

Senior Member
erco beat me
main:
dirsb=%11111111 ' set portb pins as outputs
pinsb=%11111110
SERTXD (CR, LF, #pinsb)
pause 1000

b0=pinsb : SERTXD (" %",#bit7,#bit6,#bit5,#bit4,#bit3,#bit2,#bit1,#bit0)

let pinsb=%00000000
SERTXD (" ",#pinsb)
pause 1000
goto main
 
Top