NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Microcontroller Programming » TypeCast problem
August 15, 2012 by eminthepooh |
I declare this 2D array outside my main loop as a global variable (that doesn't change), along with 2 other variables
later on, I refer to it as such:
Later on when I try to use that runTime in delay, it messes up:
Keeps seeing it as -1, It even sees Matrix1[1][0] as -1 (as outputted to the LCD via lcd_write_int16() ) What's going on? and how do I fix it? Thank you, |
---|---|
August 15, 2012 by pcbolt |
eminthepooh - The way the makefiles are set up, the AVR compiler has trouble with initialized arrays, even ones simpler than the 2-dimensional one you're using. I'd wager this might work:
There is a forum thread about this HERE where it shows a modification you can use to change the makefile to operate as expected...along with a detailed explanation. Pretty sure it is not a type cast problem. |
August 17, 2012 by eminthepooh |
Somehow got it working with specifying PROGMEM in my initialization. guess it was a compiler problem. Thanks pcbolt |
Please log in to post a reply.
Did you know that spinning a permanent magnet motor makes a voltage? Learn more...
|