microsoft / jacdac

Device and service catalogs for Jacdac.
https://aka.ms/jacdac
Creative Commons Attribution 4.0 International
66 stars 25 forks source link

Lag when animating LED ring based of STM32 (MSR JM RGB-8) #1312

Open brian-inksmith opened 1 year ago

brian-inksmith commented 1 year ago

Describe the bug We noticed an issue with our LED ring that’s based off of your MSR JM RGB-8 module. There is intermittent lag both on the physical module and it even shows up in the simulator (see attached videos).

We have a kittenbot LED ring (based off of the MSR JM RGB LED Ring?) and with the same code/service it has no lag issues. There’s an MCU difference, but one would think the STM32 in ours could handle it.

To Reproduce

Steps to reproduce the behavior:

  1. Add MSR JM RGB-8 LED ring or Forward Edu LED Ring to breakout board.
  2. Add extension https://github.com/climate-action-kits/pxt-fwd-edu
  3. Add code to rotate a single pixel around the LED ring (any pixel, 100ms delay)
  4. Observe lag (skipping pixels) as pixel rotates around ring.

Expected behavior The LED ring should operate without lag when animating.

Screenshots

2023-06-12 13_20_20-Microsoft MakeCode for micro_bit

Video led ring module.mp4 led ring sim.mp4

Desktop (please complete the following information):

Additional context This happens with the LED ring attached to any brain, both within the simulator and on the device.

mmoskal commented 1 year ago

It seems to work just fine with just the Jacdac extension. It didn't work at all for me with your extension. Maybe you can share the link the program you're using? Also try to remove stuff from your extension and see what will make it work.

brian-inksmith commented 1 year ago

The plot thickens! Our extension wraps around the Jacdac extension and shouldnt cause this problem. Especially when other LED rings work fine. But you're right, the jacdac extension alone does not exhibit the lag.

Here's the hex file that we use with the LED ring and the lag occurs.

microbit-LED-lag-test-2.zip

@ross-inksmith FYI