Tuesday, August 27, 2019

Datalogging and File Storage in MakeCode

Microsoft MakeCode is one of our favorite programming methods. It is super easy to learn, yet it has many capabilities to build more advanced projects and even really good games.

A common project in MakeCode is to read sensors like temperature, light, moisture, etc. and record or display the values for the user. The display part can be easy with lights and displays. But recording data for later use has been laborious. Here at Adafruit, we made a project to log data to a Google Sheets spreadsheet but that required attaching a phone, a big peripheral, for the full length of the data collection.

With an additional extension, MakeCode can also write data to a file, if the microcontroller has some flash memory aboard. Adafruit's Express series, which is programmable in both MakeCode and CircuitPython, has extra flash used (up to now) for CircuitPython. The MakeCode extensions Datalogger and Storage use that flash storage to allow the programmer to write data out as files.

Parts

For this project, we are going to use the Adafruit Circuit Playground Express. It has built-in sensors and 2 megabytes of flash storage all at one low price involving zero soldering. Other Express boards from Adafruit also have similar capabilities, although adding the sensors to gather data may take additional boards or wires.

Circuit Playground Express (CPX for short) comes as a round, black board from Adafruit - you might have a red Digi-Key CPX or even a green 4-H logo CPX! They all work 100% the same, so there are no worries if you see a picture and your CPX is a different color.

These packs will have all the parts you need!

No comments:

Post a Comment