updated docs
This commit is contained in:
parent
871015ea76
commit
e15ceafa58
@ -1,59 +0,0 @@
|
||||
# Sequencing
|
||||
|
||||
By calling one function after another, in sequence, you can create an animation:
|
||||
|
||||
```typescript
|
||||
basic.showLeds(`
|
||||
. # . # .
|
||||
. . . . .
|
||||
. . # . .
|
||||
# . . . #
|
||||
. # # # .
|
||||
`);
|
||||
basic.showLeds(`
|
||||
. # . # .
|
||||
. . . . .
|
||||
. . . . .
|
||||
. # # # .
|
||||
# . . . #
|
||||
`);
|
||||
```
|
||||
|
||||
### The semicolon
|
||||
|
||||
In JavaScript, the semicolon (;) is used to terminate (or end) a statement. However, in most
|
||||
cases, the semicolon is optional and can be omitted. So both code sequences below are
|
||||
legal:
|
||||
|
||||
```typescript
|
||||
basic.showNumber(1)
|
||||
basic.showNumber(2)
|
||||
```
|
||||
|
||||
```typescript
|
||||
basic.showNumber(1);
|
||||
basic.showNumber(2);
|
||||
```
|
||||
|
||||
### The empty statement
|
||||
|
||||
In JavaScript, there is the concept of an *empty statement*, which is whitespace followed by
|
||||
a semicolon in the context where a statement is expected.
|
||||
So, the following code is an infinite loop
|
||||
followed by a call to `showNumber` that will never execute:
|
||||
```typescript-ignore
|
||||
while(true) ;
|
||||
basic.showNumber(1);
|
||||
```
|
||||
|
||||
|
||||
### ~hint
|
||||
For the @boardname@, we don't allow a program to contain an empty statement, such as shown above.
|
||||
If you really want an empty statement, you need to use curly braces to delimit an empty statement block:
|
||||
```typescript
|
||||
while(true) { }
|
||||
basic.showNumber(1);
|
||||
```
|
||||
### ~
|
||||
|
||||
[Read more](http://inimino.org/~inimino/blog/javascript_semicolons) about semicolons in JavaScript.
|
@ -16,4 +16,5 @@ as well as a set of helper functions (such as displaying a number/image/string o
|
||||
## Packages
|
||||
|
||||
* [microsoft/pxt-neopixel](https://github.com/microsoft/pxt-neopixel), package for neopixel strips
|
||||
* [microsoft/pxt-filesystem](https://github.com/microsoft/pxt-filesystem), package for the file system
|
||||
* [microsoft/pxt-max6675](https://github.com/microsoft/pxt-max6675), package for Temperature Probe (MAX6675)
|
@ -1,12 +1,10 @@
|
||||
# Streaming
|
||||
# @extends
|
||||
|
||||
This page describes how to stream data from the @boardname@ to the editor or even to the cloud.
|
||||
|
||||
## Before starting...
|
||||
## Before starting... #setup
|
||||
|
||||
Make sure you follow the instructions on [how to setup a serial connection](/device/serial) with the @boardname@.
|
||||
|
||||
## A typical scenario
|
||||
## A typical scenario #example
|
||||
|
||||
A common scenario is to chart some sensor data, such as the acceleration, and analyse it in the editor.
|
||||
For example, run this code on your @boardname@.
|
||||
@ -20,13 +18,3 @@ basic.forever(() => {
|
||||
If your serial connection is working, you will start to see a chart representing that acceleration ``x`` value read from the @boardname@.
|
||||
Each time ``led.plotBarGraph`` is called, the value is also written to the serial output. The log view automatically detects
|
||||
that there is a data stream and displays a graph.
|
||||
|
||||
## Local download
|
||||
|
||||
The log view will automatically start to collect and organize the data it detects. Simply click on the log view to open the various options
|
||||
to export the data. The simplest option is to download the data as a **CSV file**. This file can easily be opened in programs like Office Excel.
|
||||
|
||||
## Cloud upload via Azure
|
||||
|
||||
In the data export dialog, there is another option to upload the data to the Azure cloud. This allows to upload small amounts of data
|
||||
without any kind setup. The data can be accessed via web services or directly from Office Excel.
|
Loading…
Reference in New Issue
Block a user