Make Code - Something wrong with your code error message

Had a weird situation with a Micro:Bit recently.
Developing code for a Robot Cart using the Kitroniks Robotics board. Added a second servo, seemed to work ok, then got to a part where a message flashed up briefly saying there was something wrong with the code and I should check it. No indication of what or why or where to look.

Initially thought the Kitroniks library was at fault. But after much investigation, creating a custom.ts file, losing the whole program (lucky I keep many backups) and removing the library the error still occurred.

Then I happened to be compiling in Javascript mode not block mode and a 1 line error appeared in the main.ts for about half a second then disappeared. After a few retries I think it said something about program too long and a number like 16 bytes or something. I removed part of the code and the new addition then worked ok.

Will have to look in more detail at the program space available etc…

To me this is a fault with Make code, such an error should not vanish but remain or there should be a log somewhere (maybe there is). If I knew it was banging up against the limits of the Micro:Bit I could have saved about 6 hours of frustration and changed my design to suit.

Most other compilers I have used have a detailed output of resources used and flag when you are pushing the limits.

Anyway, the adventure continues.

Cheers
Jim

3 Likes

God speed, Jim. We’re all rooting for you!

2 Likes

Hey Jim,

It might even be worth checking out Thonny or Mu editor, personally I use Thonny for everything RPi Pico and ESP32. I don’t have a massive amount of experience with MakeCode but from the brief interactions with it it might be worth making the swap.

I’m keen to see what else you make Jim! Keep the awesome forum posts up!!
Liam.

2 Likes

I abandoned Make Code as a programming tool for the micro:Bit and switched to Micro Python. Make Code is an excellent starting point but when you want more control over what you are doing; something like Micro Python is better.

The problem with Make Code was the script was too long. With Micro Python it is much easier to see when you will run out of space.
Also the development environment of Micro Python is much better. You can easily connect to multiple mico:Bits at the same time; error messages and debugging work much better too.

In a separate post I will show the Robot Cart as it currently stands. I am quite happy with the end result.

Cheers
Jim

2 Likes