B4R Question p10 led panel library

thetrueman

Active Member
can you look at this B4R project without "delay" ?
I tested the new test_DMD.zip and there were compilation error. I just checked the logs and found the reason. The font names should be #include <SystemFont5x7.h> instead of #include "SystemFont5x7.h". I changed this in # If C and the program compiled and downloaded successfully.

It worked but but only displayed the data from line 88 to line 150 in the B4R test project. It did not show any display from line 58 to line 87. While in my last working test project, Scrolling Text was displaying in Marquee style but not in your current project line 78 to line 88. I hope the success is not to difficult. Thanks for your kind efforts for B4R lovers.
 
Upvote 0

candide

Active Member
Licensed User
80 to 150 working : it is a good start!
58 to 87 is based is based on drawChar:
int16_t drawChar(int16_t bX, int16_t bY, byte letter, byte bGraphicsMode);
=> letter must be a byte

you can try in this way :
dmd.drawChar( 0, 3, Asc("2"), dmd.GRAPHICS_NORMAL )
dmd.drawChar( 7, 3, Asc("3"), dmd.GRAPHICS_NORMAL )
dmd.drawChar( 17, 3, Asc("4"), dmd.GRAPHICS_NORMAL )
dmd.drawChar( 25, 3, Asc("5"), dmd.GRAPHICS_NORMAL )
dmd.drawChar( 15, 3, Asc(":"), dmd.GRAPHICS_OR)
 
Upvote 0

thetrueman

Active Member
I checked with ASC modification and it is now working. Now only scrolling text routine is not working at line number 78. I changed it as Asc("Scrolling Text") but still not working. There are only some random LEDs ON when DrawMarquee routine is executed.

Please explain how the myloop functions at line number 50, CallSubPlus("DMDdraw",0,0) when we are using drawTag logic, is it necessary to use CallSubPlus?

Please clarify that this structure of updating displays via SPI after 5ms or even with 1ms could block other tasks specially serial data or it is just good way to do other things like blinking LED at 1Hz or control inputs/outputs or have to use another timer!

When the program is in delay2 loop at line number 38-40, does not it block other functions as mentioned above except the function on line number 39?

Thanks for step by step progress and being patient.
 
Upvote 0

candide

Active Member
Licensed User
for line 78, issue is the same : no update with scanDMD during the loop
un update in this way should work :
B4X:
  dmd.drawMarquee("Scrolling Text",14,(32*dmd.DISPLAYS_ACROSS)-1,0)
   Dim start As ULong =Millis()
   Dim time As ULong =start
   Dim ret As bool =False
   Do While Not(ret)
     If ((time+30) < Millis) Then
       ret=dmd.stepMarquee(-1,0)
       time=Millis
     End If
     scanDMD 
   Loop

why callsubplus in line 50 ? it is not mandatory here with only one tasc.
Without, everything is synchone and loop will continue at end of DMDdraw run
with Delay2(xxx), each time we have a delay, a loop or others times lost, we run scanDMD if needed and we have update of display.
but this loop include only display update and nothing else. It is not timer interrupt.

an other way with "callsubplus" is added:[/code]
 

Attachments

  • test_DMD.zip
    2 KB · Views: 18
Upvote 0

thetrueman

Active Member
Finally everything is working but I have to change the following in the last test_DMD. Fonts name should be between <xxx.h> symbols not "xxx.h".

B4X:
#if C
//exemple for 4 fonts
  #include <SystemFont5x7.h>
  #include <Arial_black_16.h>
  #include <Arial_Black_16_ISO_8859_1.h>
  #include <Arial14.h>

  const uint8_t * B4R::B4RDMD::myfonts[]= {
      System5x7,                      // => setfont(00)
      Arial_Black_16,                 // => setfont(01)
      Arial_Black_16_ISO_8859_1,      // => setfont(02)
      Arial_14                       // => setfont(03)
  };
#End If

Thanks so much @candide to make B4R a step ahead. Now I'll try to play with serial data to display and controlling some inputs outputs. :)
 
Upvote 0

thetrueman

Active Member
I have managed to update display via serial port on the runtime using GlobalStore but the problem is when serial data is received it stops SPI to update display which cause a flicker on display. On slow baud rate i.e. 9600 it is about 500ms and on 115200, it is about to 50ms but that is there. If we have occasionally update change data then it maybe acceptable but what if we have to update data on display every second then it is very annoying. Even I have set SPI update time from 5ms to 1ms but same situation. Can there be some interrupt based or other solution which can handle two fast speed tasks simultaneously without disturbing each other significantly. Thanks.
 
Upvote 0
Top