Class: uBit

uBit

Class to manage an individual micro:bit device

Methods

disconnect()

Request a disconnect
Source:

getCSV() → {string}

Get the data as a CSV representation This is the full, augmnted data. The first column will be the miro:bit name (not label), then an indiator of the reboot, then the wall-clock time (UTC stamp in ISO format if it can reliably be identified), then the microbit's clock time, then the data.
Source:
Returns:
The CSV of the augmented data
Type
string

getData(start, end)

Parameters:
Name Type Default Description
start number 0 Start row (inclusive)
end number End row (exclusive)
Source:
Returns:
Rows from start (inclusive) to end (inclusive) (do NOT mutate data)

getDataLength() → {number}

Source:
Returns:
The number of rows of data
Type
number

getHeaders() → {Array.<string>}

Source:
Returns:
Array of headers for the data (do NOT mutate)
Type
Array.<string>

getLabel() → {string}

Source:
Returns:
The label for the device
Type
string

getRawCSV() → {string}

Get the raw (micro:bit) data as a CSV representation. This should match the CSV retrieved from accessing the Micro:bit as a USB drive
Source:
Returns:
The CSV of the raw data
Type
string

refreshData()

Refresh (reload) all data from micro:bit (removes all local data)
Source:

remove()

Remove this device
Source:

sendAuthorization(password)

Request authorization (if connected) A correct password will be retained for future connections
Parameters:
Name Type Description
password string The password to send
Source:

sendErase()

Request an erase (if connected & authorized)
Source:

setLabel(label)

Set the label for the device
Parameters:
Name Type Description
label string
Source: