freetronics / DMD2

Beta release of a new Dot Matrix Display Arduino library
http://forum.freetronics.com/viewtopic.php?f=26&t=5893
GNU General Public License v3.0
80 stars 71 forks source link

Bug with more then 7 Displays in a row #34

Open niklasberlin opened 6 years ago

niklasberlin commented 6 years ago

Hi, I got a Displays which is made out of nine p10 Panels, if i connect my arduino uno and set the SoftDMD to a width of seven panels the first seven displays are working correctly with my test sketch (only a drawLine(0,0,287,0) ). The Panels are wired from right to left (viewed from the LED Side) according to the arrows on the Back) Panels are in order: 9, 8, 7, 6, 5, 4, 3, 2, 1 If i change the width in SoftDMG to 8 only 4 LED's light up, they are located on Panel 1 on the far right in rows 0, 1, 2 and 3 (vertical line, not horizontal line as intended by the drawLine() function)

If i change the width to nine the line is correct on panel 1, 5, 9 and shifted from row 0 to row 1 on panel 2 and 6, on panel 3 and 7 the line is shifted another row to row 2, on panel 4 and 8 the line is shifted to row 3, I hope this helps to find the error. i try to locate it myself but i'm not so experienced with this topic

pererasampath commented 5 years ago

Hi, I too got the same issue. I am checking DMD2.h file to see whether there are any limitations. but still could not found.

meetpatelvgec commented 5 years ago

I also got this issue. I had 10 modules in a row and I was using SPIDMD dmd(10,1); but it didn't seem to work. As a workaround, I placed the modules in 5 rows and 2 columns and used SPIDMD dmd(2,5); which solved my issue.

Note that if you decide to follow this approach, then the digits are located at below (X,Y) cordinates:

  1. (0,0)
  2. (32,0)
  3. (0,16)
  4. (32,16)
  5. (0,32)
  6. (32,32)
  7. (0,48)
  8. (32,48)
  9. (0,64)
  10. (32,64)
shr34sachin commented 5 years ago

I am also having the issue with (8,1) with SPIDMD for esp8266 nodemcu. Upto 7, it works fine. The solution as presented by meetpatelvgec won't work for me since I am using custom font and and that I need to increase the number of columns as (8,1), no other way around. Did anyone manage to find the bug in the library? Thank you!

pererasampath commented 5 years ago

I found a fix for this. The variable that holds the panel dimensions is type byte and when the value exceeds 8 it fails. So I edited DMD2.h or DMD2.cpp , do not remember exactly which file and which place and entered the numeric values instead of variable and compiled. it worked. Try out. I'll try to find the exact place and post here.

shr34sachin commented 5 years ago

Thanks a lot @pererasampath. I will give that a try. In case if you happened to find the exact location within the code, please let me know.

roffy255 commented 5 years ago

i got same issue. After horizontal series of 7 display, which was working fine, i added one more display in series and updated code SPIDMD dmd(8, 1). It didnt work. I tried to replace all byte variables to int16_t variables in DMD2.h, DMD2.cpp, DMDFrame.cpp. didnt changed anything.. Still got same issue. @pererasampath, waiting for your post !

shr34sachin commented 5 years ago

Hi @pererasampath, did you manage to find the places that you have changed? I tried changing datatype of different variables but still couldn't figure that out. Thank you!

shr34sachin commented 5 years ago

Finally solved the issue, it was the issue of overflow as has been mentioned by @pererasampath. Need to edit the datatype in the class DMDFrame. Thanks to @pererasampath for right direction.

ElectronicRescue commented 5 years ago

@shr34sachin Are you able to post the code that has to be edited so that this library can be fixed? Or even open a pull request with the fix.

shr34sachin commented 5 years ago

@ElectronicRescue I have posted the code and opened the pull request for the fix. Sorry, I got busy and so can't respond immediately. Thank you!

pererasampath commented 5 years ago

Hi, very sorry. I was hospitalized and could not respond timely. Glad @shr34sachin found the and fix the bug. Would like to see the fixed code. Sorry I have no idea of the pull request. Can we see the code?

shr34sachin commented 5 years ago

@pererasampath Pls check the pull request section, the changes made in two of the files could be found there.