adding a few more examples

This commit is contained in:
Peli de Halleux 2017-02-09 17:40:21 -08:00
parent 45c82767d0
commit a4a74bdd6b
5 changed files with 64 additions and 0 deletions

View File

@ -2,6 +2,23 @@
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
@ -11,5 +28,8 @@ Here are some fun programs for your @boardname@!
}, {
"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 Analog Pin
```blocks
basic.forever(() => {
led.plotBarGraph(
pins.analogReadPin(AnalogPin.P0),
1023
)
})
```

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))
})
```