variables problem - what is the difference

Hi guys,

I´m doing a little bit in programming a soundroutine and have this problem:


o1.amplitude_increment = int16_t o1.framecounter = uint32_t


 o1.amplitude_increment = int(32640/o1.framecounter);

seems not to be the same as

byte o1.amplitude_max = 9;

int32_t amplitude_max_array [10] PROGMEM = {32640,0,0,0,0,0,0,0,32640,32640};

 o1.amplitude_increment = int(amplitude_max_array[o1.amplitude_max]/o1.framecounter);

It seems to be an overflow, but I can´t see why. Which varible-type has to be amplitude_max_array?

Maybe, I´m too stupid. But I didn´t see the bug.


Please read

With PROGMEM you need to use types like prog_int32_t, and access the array with a function like pgm_read_dword_near()

Your´re right. Some mistakes are too stupid! Thanx!