From 672672e63237560d3a2ff98686c1e77685e0cfde Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Thu, 9 Feb 2017 14:44:56 -0800 Subject: [PATCH] adding example pages --- docs/docs.md | 1 + docs/examples.md | 13 +++++++++++++ docs/examples/plot-acceleration.md | 10 ++++++++++ docs/examples/plot-light-level.md | 10 ++++++++++ pxtarget.json | 1 + 5 files changed, 35 insertions(+) create mode 100644 docs/examples.md create mode 100644 docs/examples/plot-acceleration.md create mode 100644 docs/examples/plot-light-level.md diff --git a/docs/docs.md b/docs/docs.md index 8b7d90a1..b58957b1 100644 --- a/docs/docs.md +++ b/docs/docs.md @@ -6,6 +6,7 @@ * **[Getting Started](/getting-started)** * [Projects](/projects) +* [Examples](/examples) * [Lessons](/lessons) ### @boardname@ reference diff --git a/docs/examples.md b/docs/examples.md new file mode 100644 index 00000000..c4484af0 --- /dev/null +++ b/docs/examples.md @@ -0,0 +1,13 @@ +# Examples + +Here are some fun programs for your @boardname@! + +```codecard +[{ + "name": "Plot Acceleration", + "url":"/examples/plot-acceleration" +}, { + "name": "Plot Light Level", + "url":"/examples/plot-light-level" +}] +``` diff --git a/docs/examples/plot-acceleration.md b/docs/examples/plot-acceleration.md new file mode 100644 index 00000000..c8d6ad8a --- /dev/null +++ b/docs/examples/plot-acceleration.md @@ -0,0 +1,10 @@ +## Plot Acceleration + +```blocks +basic.forever(() => { + led.plotBarGraph( + input.acceleration(Dimension.X), + 1023 + ) +}) +``` diff --git a/docs/examples/plot-light-level.md b/docs/examples/plot-light-level.md new file mode 100644 index 00000000..ba8193e4 --- /dev/null +++ b/docs/examples/plot-light-level.md @@ -0,0 +1,10 @@ +## Plot Light level + +```blocks +basic.forever(() => { + led.plotBarGraph( + input.lightLevel(), + 255 + ) +}) +``` diff --git a/pxtarget.json b/pxtarget.json index cf48e638..7b85b947 100644 --- a/pxtarget.json +++ b/pxtarget.json @@ -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",