The MakeCode program acts 100% like the CircuitPython code. You will need to take a couple of steps to set up MakeCode to use Keyboard extension blocks to have the days go into individual spreadsheet cells.
As of this guide (August 14, 2018) you will need to use the beta web version of MakeCode.
As this uses the Keyboard extension which has some very new edits. They should be in the main MakeCode builds later in the month.
Select the Keyboard extension and a new block, group colored black, named KEYBOARD will be available. You can use the blocks in this group to move the arrow keys in the spreadsheet.
The following program will take three readings:
- time relative to the power-on of the board, not time of day - this is the millis (ms) block
- light intensity - this is not in lux but it does have higher numbers when theres more light. This is the light level block
- temperature in Celsius or Fahrenheit, this is the temperature block
The values are written out via Keyboard emulation to your computer.
Here's the full MakeCode block set:
You should have your computer open to a spreadsheet where you want the data (often cell A1). You can use Excel, Google sheets, OpenOffice Calc...anything you like!
Note that this code will not work with a word processor as-is as it assumes using arrow keys and tabs to change columns. The character 9 in the data writes is the standard code for the tab key so the numbers are written and the code will output a tab afterwards going to the next cell in the spreadsheet.
When the slide switch is closed, moved toward the black speaker, it does not log data. When the switch is moved towards the microphone, data will be "typed" out by the board and populate your spreadsheet. Moving the switch back stops the logging so you can use your regular keyboard without numbers being injected into your work.
Feel free to make changes to read other sensors. Also you can use the Pause block to slow down readings in case you believe the readings are being taken too quickly.
See the Adafruit tutorial Make it a Keyboard for additional keyboard examples.