diff --git a/README.md b/README.md index 3cebba6..ff15e9d 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,14 @@ # 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 @@ -17,7 +16,6 @@ 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. @@ -43,7 +41,6 @@ basic.forever(() => { ``` ## writeLine - The ``||dataStreamer.writeString||`` block writes a new line to the serial port. ```sig @@ -51,7 +48,6 @@ dataStreamer.writeLine(); ``` ### Example: Writing values in a loop - This program writes a series of accererlation values to the serial port repeatedly. ```blocks @@ -62,7 +58,6 @@ basic.forever(function () { ``` ## writeString - The ``||dataStreamer.writeString||`` block writes a string to the serial port, without starting a new line afterward. ```sig @@ -70,11 +65,9 @@ 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 @@ -89,7 +82,6 @@ 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 @@ -97,11 +89,9 @@ 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 @@ -113,11 +103,9 @@ basic.forever(function () { dataStreamer.writeNumberArray(acc) dataStreamer.writeLine() }) - ``` ## setBaudRate - The ``||dataStreamer.setBaudRate||`` sets the baud rate. Default is 9600 for datastreamer ```sig @@ -125,7 +113,6 @@ dataStreamer.setBaudRate(9600); ``` ### Parameters - * `rate` is the number for the baud rate ## License