Hi,
I am wondering why is is not possible to group i/o pins into a cluster or array?
It would be nice to declare at once the I/O pins and access them as index array
example
' create array of input pins
dim input_pins(3)
input_pins(1)=portA0 input_pins(2)=portB0 input_pins(3)=portB1 set n=3 then refer to this variable to access the port
for i=1 to n val(i)=ReadAD(input_pins(i))
next
this way it would be easy to port code from one MCU to another by just changing the reference to the port in the declaration
in case they have a very different port assignment.
just a though or I am missing something?
thanks
Florante
Log in to post a comment.
Hi,
I am wondering why is is not possible to group i/o pins into a cluster or array?
It would be nice to declare at once the I/O pins and access them as index array
example
' create array of input pins
dim input_pins(3)
input_pins(1)=portA0
input_pins(2)=portB0
input_pins(3)=portB1
set n=3
then refer to this variable to access the port
for i=1 to n
val(i)=ReadAD(input_pins(i))
next
this way it would be easy to port code from one MCU to another by just changing the reference to the port in the declaration
in case they have a very different port assignment.
just a though or I am missing something?
thanks
Florante