Skip to content

Commit

Permalink
Update Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
abchatra authored Oct 19, 2018
1 parent 91bf336 commit 3ae4754
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
# Hacking STEM [![Build Status](https://travis-ci.org/Microsoft/pxt-hacking-stem.svg?branch=master)](https://travis-ci.org/Microsoft/pxt-hacking-stem)

Support for [Hacking STEM](https://www.microsoft.com/en-us/education/education-workshop/activity-library.aspx) activities in [micro:bit](https://makecode.microbit.org). For Hacking Stem activities you will need excel add-on Data Streamer as well. To download Data Streamer [click here](https://www.microsoft.com/en-us/download/details.aspx?id=56976)
Support for [Hacking STEM](https://www.microsoft.com/en-us/education/education-workshop/activity-library.aspx) activities in [micro:bit](https://makecode.microbit.org). For Hacking Stem activities you will need excel add-on Data Streamer as well. To download Data Streamer [click here](https://www.microsoft.com/en-us/download/details.aspx?id=56976). This extension helps build the code for emitting serial data in the format required by Data Streamer excel addon.

## Usage

Go to https://makecode.microbit.org, click on the gearwheel menu and select ``Extensions``, search for ``hacking stem`` and select this extension. Once you load the extension you should see a new category named DataStreamer.
Go to https://makecode.microbit.org, click on the gearwheel menu and select ``Extensions``, search for ``hacking stem`` and select this extension. Once you load the extension you should see a new category named DataStreamer. Hacking Stem extension sets the baud rate of serial output to 9600 as required by data streamer add-on in excel.

## Reference
Following are the API reference:

## writeNumber

The ``||dataStreamer.writeNumber||`` block writes a number to the serial port as a floating point number.

```sig
dataStreamer.writeNumber(1.52, 2);
```

### Parameters

* `value` is the floating point number to write to the serial port
* `decimal digits` is the number of decimal digits to write. Default is 2.

Expand All @@ -43,15 +41,13 @@ basic.forever(() => {
```

## writeLine

The ``||dataStreamer.writeString||`` block writes a new line to the serial port.

```sig
dataStreamer.writeLine();
```

### Example: Writing values in a loop

This program writes a series of accererlation values to the serial port repeatedly.

```blocks
Expand All @@ -62,19 +58,16 @@ basic.forever(function () {
```

## writeString

The ``||dataStreamer.writeString||`` block writes a string to the serial port, without starting a new line afterward.

```sig
dataStreamer.writeString(",");
```

### Parameters

* `text` is the string to write to the serial port

### Example: Writing comma seperated values in a loop

This program writes a comma `,` seperated x,y,z acceleration values to the serial port repeatedly..

```blocks
Expand All @@ -89,19 +82,16 @@ basic.forever(function () {
```

## writeNumberArray

The ``||dataStreamer.writeNumberArray||`` block writes a array of numbers to the serial port as a comma seperated values, without starting a new line afterward.

```sig
dataStreamer.writeNumberArray([0,1,2]);
```

### Parameters

* `text` is the string to write to the serial port

### Example: Writing comma seperated values in a loop

This program writes a comma `,` seperated x,y,z acceleration values to the serial port repeatedly.

```blocks
Expand All @@ -113,19 +103,16 @@ basic.forever(function () {
dataStreamer.writeNumberArray(acc)
dataStreamer.writeLine()
})
```

## setBaudRate

The ``||dataStreamer.setBaudRate||`` sets the baud rate. Default is 9600 for datastreamer

```sig
dataStreamer.setBaudRate(9600);
```

### Parameters

* `rate` is the number for the baud rate

## License
Expand Down

0 comments on commit 3ae4754

Please sign in to comment.