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",