pulsout comand

sid

Senior Member
I'm using the following piece of code in a program
Code:
route1:
gosub sub1
let pins =%10000000
let pinsc=%01000001
goto start
And it works fine.
I've started experimenting with the pulsout command and found that if I add the following line of code
Code:
pulsout %10000000,500
it seems to pass the syntax test but does not work when transfred to an axe.
But if I leave the pins= or pinsc= command in the program, the syntax test fails.
All of which is a long winded way of asking "is it possible to use the pulsout function with a pins=%00000000 instruction, so all the outputs can be made to flash on/off" ?. I can't find any reference in the manuals to this.
 

hippy

Ex-Staff (retired)
The syntax is "PULSOUT pinNumber, duration", Your pin number is %10000000, 128 in decimal, and there isn't a pin 128.

The compiler accepts the code because it is looking for a number, any number will do, and a number is what you gave it. Not sure what you mean about your syntax error as you haven't stated what PICAXE you are using.

The PULSOUT ( and many other commands ) only allow one pin to be controlled at a time. If you want to pulse all pins on then off, one solution is ...

pins = %11111111
PAUSE 500
pins = %00000000
 

sid

Senior Member
The syntax is "PULSOUT pinNumber, duration", Your pin number is %10000000, 128 in decimal, and there isn't a pin 128.

The compiler accepts the code because it is looking for a number, any number will do, and a number is what you gave it. Not sure what you mean about your syntax error as you haven't stated what PICAXE you are using.

The PULSOUT ( and many other commands ) only allow one pin to be controlled at a time. If you want to pulse all pins on then off, one solution is ...

pins = %11111111
PAUSE 500
pins = %00000000
Well that answers that one, thanks.
I was just wondering if all the pins could be left to pulse on/off while the program moves onto the next comand, a bit like pwm.
 

eclectic

Moderator
Well that answers that one, thanks.
I was just wondering if all the pins could be left to pulse on/off while the program moves onto the next comand, a bit like pwm.
Yes, but you would need another Picaxe as the "master".

A "slave" 28X1 could flash all 16 outputs,
while the "Master" did other things.

Rough idea here:

Code:
#picaxe 28x1
#no_data
#no_table

 let dirsC = %11111111
 symbol delay = 20  ; change as needed

main:
let pins  = %11111111
let pinsC = %11111111  ; all 16 ON

pause delay

let pins  = %00000000
let pinsC = %00000000  ; all 16 OFF

wait 2 ; change as needed
goto main

; use the READADC pins for control
e
 

sid

Senior Member
Yes, but you would need another Picaxe as the "master".

A "slave" 28X1 could flash all 16 outputs,
while the "Master" did other things.

Rough idea here:

Code:
#picaxe 28x1
#no_data
#no_table

 let dirsC = %11111111
 symbol delay = 20  ; change as needed


main:
let pins  = %11111111
let pinsC = %11111111  ; all 16 ON

pause delay

let pins  = %00000000
let pinsC = %00000000  ; all 16 OFF

wait 2 ; change as needed
goto main

; use the READADC pins for control
e
e, many thanks,Sid
 
Top