PDA

View Full Version : Define Outputs



MattCritt
- 26th March 2013, 15:58
I am curious is there any way to define a variable as a group of output pins.

such as

Variable=porta.1 portb.1 portb.3


is this possible?

thanks,

spcw1234
- 27th March 2013, 01:08
Not sure exactly what result you are looking for by combining the ports? Something like this might work.



variable var byte
variable.bit2 = porta.1 : variable.bit1 = portb.1 : variable.bit0 = portb.3

HenrikOlsson
- 27th March 2013, 06:04
Hi,
There's no way to redefine the pins and then write them in one go as if they were a true single port, ie they will not be written at the exact same time like they would with something like PortB=123. With that said and with those limitations in mind I think that Darrels VirtualPort routine may do what you want. Have a look at this thread (http://www.picbasic.co.uk/forum/showthread.php?t=12502&highlight=VirtualPort) and do a forum search for VirtualPort.

/Henrik.