Gator:Log

I would like the read the data that is collected on the SD card using the micro:bit. For example, I would like to read through the lines in a file containing the data I collected and use those values to construct a time lapse of how the data changes using the LEDs on the micro:bit.

This doesn’t need to be block friendly as long as I can write the typescript I need in makecode. I’ve looked at the github implementation, but could use some guidance on how to read from the file namely what is the writeReady and command ready characters mean? Is there a corresponding readReady character?

Thanks!

Alex

Hi Alex.

The Gator:log is the same product as our OpenLog, but in a different form factor. Have a look at the hookup guide for the [OpenLog and that should get you on the right path. :-)](OpenLog Hookup Guide - SparkFun Learn)

Okay. That helps. I’m looking at the code for the gator:log blocks (https://github.com/sparkfun/pxt-gator-l … atorlog.ts) and I see how writing works by redirecting serial to the TX,RX pins and writing the openLog commands over serial to the SD card logger. However I am not sure how to read the file. I can write the read file command to the logger serial.writeString("read " + “moldData.csv” + carriageReturn). However how can I actually retrieve the file data on the MakeCode side when serial.writeString is a void function? Is this possible?

Thanks!

Alex

Hi Alex.

I don’t believe we included support for reading files from the OpenLog in MakeCode. You’d need code it by hand to access the gator:log serially. Perhaps in the future we can include that functionality in MakeCode, but for now, it’s write only as far as data goes.