Mega 2560 code Help...
 
Notifications
Clear all

Mega 2560 code Help Please!

9 Posts
4 Users
0 Reactions
3,205 Views
Posts: 5
Topic starter
(@wildbill72)
Active Member
Joined: 8 years ago

Is there anyway this can be converted or modified to drive 349 pixels? Like I said, I am a newbie and would appreciate the help. If not, I'll just run my Fast LED Demo for this year until I get educated to write my own stuff for next Christmas. By the way, I did change to 250 pixels and the program worked fine, but only for 250 pixels.
Thanks for all the help!!!


Reply
Posts: 58
(@wood-guy)
Trusted Member
Joined: 15 years ago

Lines like the one below are the problem. Around lines 136 and 143

for (uint8_t i = 0; i < NUMPIX; i++) {

change them to

for (int16_t i = 0; i < NUMPIX; i++) {


Reply
Posts: 2541
(@lightup)
Famed Member
Joined: 17 years ago
MartinMueller2003 wrote:that is because those variables I mentioned are loop indexes....

Thanks Martin for that kernel of insight I missed. It makes perfect sense when one looks at the FOR loop where NUMPIX variable is used with an int variable. DUH ....
I changed those int's to int16_t where the FOR loop uses the NUMPIX variable and now the program doesn't freeze. I think that was the problem with the code. Someone pushed the original code passed it inherent limits. With NUMPIX = 400 it still doesn't freeze and seems to work just fine.


Reply
Posts: 5
Topic starter
(@wildbill72)
Active Member
Joined: 8 years ago

YOU GUYS ROCK! Thanks for the help! I made the changes and things work fine.
Merry Christmas!:happycrying:


Reply
Page 2 / 2
Share: