Skip to main content
2 of 2
deleted 43 characters in body
jami
  • 111
  • 2

The error message is correct. You did not define the size of the array. You have 3 choices:

  1. Declare it with a constant length

    int foo[10];

  2. Declare it and initalize it

    int foo[] = {0,1,2,3,4,5,6,7,8,9};

  3. Declare it dynamic as pointer and alloc or realloc the mem by yourself (this is not recommended (realloc) because of possible heap memory fragmentation)

    int foo; int size = 10; foo = (int)malloc(size * sizeof(int)); free(foo);

As reference: http://www.arduino.cc/en/pmwiki.php?n=Reference/Array

jami
  • 111
  • 2