Search code examples
gnat

Ada on microbit, GNAT


So, I have a project where I need to program a Real time system on the microbit using Ada https://blog.adacore.com/ada-on-the-microbit

I've come accross a problem, by using the arm-elf library and compiler I seem to lose access to all Ada base libraries, that is, the only one I can use is Ada.Text_IO, all others can't seem to be found by the IDE

I want to debug my code, printing the data I'm receiving from the accelerometer, but it's a number, and the library Ada.Text_IO only works with strings, so I tried to use Ada.Integer_Text_IO which was not found.

But if I change in project settings to the ada base compiler, I can compile and build my code (which means the code is correct), but I'm missing the button to flash it to the microbit


Solution

  • Well, the runtime provided for the MicroBit is a ZFP which means Zero FootPrint runtime. So you shouldn't expect all the standard library to be implemented... But expect that there's nothing :) In fact, you only have what exists in the Ada drivers library.

    Moreover, what would be IO on such a microcontroller ? Where do you expect it to output ?

    If you want to output something, take a look at this example and use Image attribute of your number.