r/FLL • • 26d ago

Help with PyBricks loader code

Hello!

So, my students have been programming with PyBricks this year. It is MUCH, MUCH easier for kids to pick up, and integrate gyroscope into the drive base, and get consistent results.

The hard part is that Pybricks by default (my understanding anyway) only comes with 5 program slots (and I am not sure how to load the code into different slots). So I wrote up a quick loader, but I am having a hard time getting the code inside 'Slot 0' to run:

PyBricks Main Loop

My left and right button presses works fine and the display updates on the Spike Prime brick and it prints the debug messages.

However, when I try to select slot 0 and run the code, it crashes.

Sometimes it crashes after "Running code in slot 0" printed, sometimes it will print "Executing Program 0" as well (which indicates it actually called (Slot 0). I think I am setting up some sort of race condition, or something?

Thanks,

-=- Terence

5 Upvotes

4 comments sorted by

View all comments

1

u/barefootsanders 22d ago

Hitting the same issues with pybricks firmware. 5 slots is kinda limiting. There are a bunch of similar questions on GitHub asking about it, but it doesn’t seem to be changing anytime. I was tempted to fork the firmware and expand the slots and get the numbers on the hub back. Curious if anyone would be interested in something like this