Skip to main content
added 1 character in body
Source Link
Nick Gammon
  • 38.9k
  • 13
  • 70
  • 126
float acc[500];
int read_time[500];

Right, so a float is 4 bytes on this platform, so that array takes 2000 bytes. And an int is 2 bytes, so that other array is another 1000 bytes.

The Uno ashas 2KB of RAM, so those two declarations alone take up more RAM than the device has.

I'm a little surprised it works at all, but certainly "not working as expected" is indeed an expected outcome here.

float acc[500];
int read_time[500];

Right, so a float is 4 bytes on this platform, so that array takes 2000 bytes. And an int is 2 bytes, so that other array is another 1000 bytes.

The Uno as 2KB of RAM, so those two declarations alone take up more RAM than the device has.

I'm a little surprised it works at all, but certainly "not working as expected" is indeed an expected outcome here.

float acc[500];
int read_time[500];

Right, so a float is 4 bytes on this platform, so that array takes 2000 bytes. And an int is 2 bytes, so that other array is another 1000 bytes.

The Uno has 2KB of RAM, so those two declarations alone take up more RAM than the device has.

I'm a little surprised it works at all, but certainly "not working as expected" is indeed an expected outcome here.

Source Link
Nick Gammon
  • 38.9k
  • 13
  • 70
  • 126

float acc[500];
int read_time[500];

Right, so a float is 4 bytes on this platform, so that array takes 2000 bytes. And an int is 2 bytes, so that other array is another 1000 bytes.

The Uno as 2KB of RAM, so those two declarations alone take up more RAM than the device has.

I'm a little surprised it works at all, but certainly "not working as expected" is indeed an expected outcome here.