View on GitHub

pxt-ADTools

ADTools MakeCode extension

Open this page at https://adumont.github.io/pxt-ADTools/

Use as Extension

This repository can be added as an extension in MakeCode.

Edit this project Build status badge

To edit this repository in MakeCode.

Usage

packNums

Say we have some sensors readings, and we want to send sensors via Radio. ADTools.packNums() lets us pack them all into a string we can send in a single message, like this:

let sensors = [0.2, 251, 0.01, 895]
// @highlight
let send = ADTools.packNums(sensors, Delimiters.Pipe)

unpackNums

On the receiving end, say we received the packed string via Radio, we can unpack a string into an array of numbers using ADTools.unpackNums(), like this:

// @highlight
let received = ADTools.unpackNums(send, Delimiters.Pipe)

logString

Logs a string to the console (for debugging purpose).

ADTools.logString("Hello world")

logNumber

Logs a number to the console (for debugging purpose).

ADTools.logNumber(25)

Full Example

This image shows the blocks code from the last commit in master. (This image may take a few minutes to refresh).

A rendered view of the blocks

Metadata (used for search, rendering)