diff --git a/docs/examples.md b/docs/examples.md index f9659fd4..02328909 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -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" }] ``` diff --git a/docs/examples/blinky.md b/docs/examples/blinky.md new file mode 100644 index 00000000..067e4fa8 --- /dev/null +++ b/docs/examples/blinky.md @@ -0,0 +1,20 @@ +# Blinky + +```blocks +basic.forever(() => { + basic.showLeds(` + . # . # . + # # # # # + # # # # # + . # # # . + . . # . .` + ); + basic.showLeds(` + . . . . . + . . . . . + . . . . . + . . . . . + . . . . .` + ); +}) +``` \ No newline at end of file diff --git a/docs/examples/name-tag.md b/docs/examples/name-tag.md new file mode 100644 index 00000000..483f6b5d --- /dev/null +++ b/docs/examples/name-tag.md @@ -0,0 +1,7 @@ +# Name Tag + +```blocks +basic.forever(() => { + basic.showString("JAMES") +}) +``` \ No newline at end of file diff --git a/docs/examples/plot-analog-pin.md b/docs/examples/plot-analog-pin.md new file mode 100644 index 00000000..c9bc725a --- /dev/null +++ b/docs/examples/plot-analog-pin.md @@ -0,0 +1,10 @@ +# Plot Analog Pin + +```blocks +basic.forever(() => { + led.plotBarGraph( + pins.analogReadPin(AnalogPin.P0), + 1023 + ) +}) +``` diff --git a/docs/examples/rando.md b/docs/examples/rando.md new file mode 100644 index 00000000..da4399bd --- /dev/null +++ b/docs/examples/rando.md @@ -0,0 +1,7 @@ +# Rando + +```blocks +basic.forever(() => { + led.toggle(Math.random(5), Math.random(5)) +}) +``` \ No newline at end of file