Array of Objects using structs

For the life of me I cannot figure out why this code does not work. Any ideas would be greatly appreciated. The Serial.print(“TEST”) in loop works fine but when I try to set and print the attributes in a for loop through the objects I get no output on the Serial Monitor.

ObjectTest.ino (670 Bytes)

Why make us download your code? It is not too big to fit in a post. See the “how to use the forum-please read” stickies to see how to post code.

for (int o = 0; o > 199; o++)

Your index o starts when you array finishes (i.e. from 200 onwards) where, of course, there is no data.

As the array is never in fact accessed, it is optimized out. Now if you change your test to < or <=, you’ll find that your array of struct [200], together with the rest of your data, is looking for 2602 bytes which is of course, over the top. Your struct is 12 bytes, 200 of these blows up.

Thanks. Such a rookie mistake

If you consider your problem resolved, please edit your post to include SOLVED in the subject text. This will save others the time from looking at a closed issue. Thanks.