Other Parts Discussed in Thread: C2000WARE
I'm new in the Microcontrollers programming and I'm trying to interact in a for loop with the some inputs GPIOs but i don't know how should do it.
# define Rows 4
int input_pin[Rows] = {GpioDataRegs.GPADAT.bit.GPIO1, GpioDataRegs.GPADAT.bit.GPIO2, GpioDataRegs.GPADAT.bit.GPIO3, GpioDataRegs.GPADAT.bit.GPIO4};
int r;
for ( r = 0; r < Rows; r++)
{
if (&input_pins[r] == 0)
do some stuff;
}
I'm trying a code with a definition like this (this is not all the project, BTW) but give me the error " identifier input_pins is undefined and must have a constant value) i think that input_pin it should be a volatile structure but I'm not sure how its implemented, I'm just trying to interreact in a for loop or any kind of loop like this, any suggestions please, thanks for your time