Using a #define to load an array


is possible add header file:

#define num 4
#define numbers {3,11,4,6}


then in function have:

for(a=0;a>=num;a++)
{
myvar[a]=numbers;
}

so myvar filled like:

myvar[0]=3
myvar[1]=11
myvar[2]=4
myvar[3]=6

or there easier way....

yes, is.


Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > Using a #define to load an array


arduino

Comments

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums