MakeCode

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.

Setup

As of this guide (August 14, 2018) you will need to use the beta web version of MakeCode.

https://makecode.adafruit.com/beta

As this uses the Keyboard extension which has some very new edits. They should be in the main MakeCode builds later in the month.

To install the Keyboard extension, click on the ADVANCED block then the EXTENSIONS.

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.

How it Works

The following program will take three readings:

  1. time relative to the power-on of the board, not time of day - this is the millis (ms) block
  2. light intensity - this is not in lux but it does have higher numbers when theres more light. This is the light level block
  3. 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:

The Spreadsheet

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.

Changes

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.

Additional use of Keyboard Commands

See the Adafruit tutorial Make it a Keyboard for additional keyboard examples.

This guide was first published on Aug 14, 2018. It was last updated on Aug 14, 2018. This page (MakeCode) was last updated on Dec 14, 2019.