Compare commits

..

8 Commits

Author SHA1 Message Date
a5cb663316 0.9.4 2017-02-09 22:52:07 -08:00
1dd0c1793e Bump pxt-core to 0.11.28 2017-02-09 22:52:05 -08:00
a4a74bdd6b adding a few more examples 2017-02-09 17:40:21 -08:00
45c82767d0 fixed titles 2017-02-09 14:57:38 -08:00
0c77927f35 fixing example page format 2017-02-09 14:51:12 -08:00
672672e632 adding example pages 2017-02-09 14:44:56 -08:00
fe2ae855b0 0.9.3 2017-02-09 11:02:28 -08:00
6612080885 Bump pxt-core to 0.11.27 2017-02-09 11:02:26 -08:00
10 changed files with 103 additions and 2 deletions

View File

@ -6,6 +6,7 @@
* **[Getting Started](/getting-started)**
* [Projects](/projects)
* [Examples](/examples)
* [Lessons](/lessons)
### @boardname@ reference

35
docs/examples.md Normal file
View File

@ -0,0 +1,35 @@
# Examples
Here are some fun programs for your @boardname@!
## Fun stuff
```codecard
[{
"name": "Blinky",
"url":"/examples/blinky"
},
{
"name": "Name Tag",
"url":"/examples/name-tag"
},
{
"name": "Rando",
"url":"/examples/rando"
}]
```
## Sensors
```codecard
[{
"name": "Plot Acceleration",
"url":"/examples/plot-acceleration"
}, {
"name": "Plot Light Level",
"url":"/examples/plot-light-level"
}, {
"name": "Plot Analog Pin",
"url":"/examples/plot-analog-pin"
}]
```

20
docs/examples/blinky.md Normal file
View File

@ -0,0 +1,20 @@
# Blinky
```blocks
basic.forever(() => {
basic.showLeds(`
. # . # .
# # # # #
# # # # #
. # # # .
. . # . .`
);
basic.showLeds(`
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .`
);
})
```

View File

@ -0,0 +1,7 @@
# Name Tag
```blocks
basic.forever(() => {
basic.showString("JAMES")
})
```

View File

@ -0,0 +1,10 @@
# Plot Acceleration
```blocks
basic.forever(() => {
led.plotBarGraph(
input.acceleration(Dimension.X),
1023
)
})
```

View File

@ -0,0 +1,10 @@
# Plot Analog Pin
```blocks
basic.forever(() => {
led.plotBarGraph(
pins.analogReadPin(AnalogPin.P0),
1023
)
})
```

View File

@ -0,0 +1,10 @@
# Plot Light level
```blocks
basic.forever(() => {
led.plotBarGraph(
input.lightLevel(),
255
)
})
```

7
docs/examples/rando.md Normal file
View File

@ -0,0 +1,7 @@
# Rando
```blocks
basic.forever(() => {
led.toggle(Math.random(5), Math.random(5))
})
```

View File

@ -1,6 +1,6 @@
{
"name": "pxt-microbit",
"version": "0.9.2",
"version": "0.9.4",
"description": "micro:bit target for PXT",
"keywords": [
"JavaScript",
@ -36,6 +36,6 @@
"semantic-ui-less": "^2.2.4"
},
"dependencies": {
"pxt-core": "0.11.26"
"pxt-core": "0.11.28"
}
}

View File

@ -208,6 +208,7 @@
"termsOfUseUrl": "https://go.microsoft.com/fwlink/?LinkID=206977",
"githubUrl": "https://github.com/Microsoft/pxt-microbit",
"projectGallery": "projects",
"exampleGallery": "examples",
"crowdinProject": "kindscript",
"boardName": "micro:bit",
"sideDoc": "tutorials/getting-started",