You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to create some animations for the led matrix, however I noticed that the commands are only received every frame (at 60fps) even at high baud rate. This means updating all 9 columns at once results in a maximum of 60fps. Black and white animations can be run at 60fps sending everything in the 39 bytes, but this is impossible for grayscale animations at the moment. Would it be possible to add a command for sending all 306 bytes of grayscale image data?
An easier improvement would be to reduce the delay time for sending the whole column and not clear the column buffer by default.
Here is a code example of what I am trying to accomplish, note the FPS counter
importserialimporttimeimportrandomFLUSH_BUFFER=0x08SEND_COL=0x07defsend_command(s, command_id, parameters, with_response=False):
s.write([0x32, 0xAC, command_id] +parameters)
ifwith_response:
res=s.read(32)
returnress=serial.Serial("COM3", 115200)
while(1):
start=time.time()
# loop 10 times to get a good avg fpsfor_inrange(10):
foriinrange(9):
arr= [i]+[random.randint(0, 255) forqinrange(34)]
send_command(s, SEND_COL, arr, with_response=False)
send_command(s, FLUSH_BUFFER, [], with_response=False)
end=time.time()
print("FPS: ", 1/((end-start)/10))
I was trying to create some animations for the led matrix, however I noticed that the commands are only received every frame (at 60fps) even at high baud rate. This means updating all 9 columns at once results in a maximum of 60fps. Black and white animations can be run at 60fps sending everything in the 39 bytes, but this is impossible for grayscale animations at the moment. Would it be possible to add a command for sending all 306 bytes of grayscale image data?
An easier improvement would be to reduce the delay time for sending the whole column and not clear the column buffer by default.
Here is a code example of what I am trying to accomplish, note the FPS counter
Output:
FPS: 5.92586648213136
FPS: 5.925065363114918
FPS: 5.88382407939697
FPS: 5.9254545945151
FPS: 5.927377226756621
FPS: 5.880792332361544
FPS: 5.923988337622522
FPS: 5.926013000679308
FPS: 5.881560904169057
The text was updated successfully, but these errors were encountered: