Skip to content

examples

EricGebhart edited this page Sep 27, 2021 · 1 revision

Examples

Within SPR it's self there is a lot of sample spr code. It has been eating itself, and python code is disappearing. Beyond that looking at the actual SPR modules, Some Real Example projects can be found here. This includes the current version of what was Particle Board REPL, called T5 is here.

All of it is so much less code than before. There is some Yaml, and a few SPR functions.

Running SPR in that folder will give a process to program and test a particle.io based device. Running in the REPL and doing load-file of the .spr also works. It would be informative to execute each step of initialize to see how it works.

Any functionality beyond initialize will fail without a proper device plugged in However it would still be informative to understand at least the setup.

load-file t5.spr

  • start by seeing what things do.

    • pioe/help,
    • help pioe/initialize
    • help pio/initialize
    • help dev/initialize
    • help dedupwith
  • Look at what there is.

    • ls-with - note that the stack is shown upside down.
    • show
  • Run some steps manually, and look.

    • pio/initialize
    • ls-with
    • show
    • with /config/R5Setup
    • show
    • with /device
    • show
    • ls-with
    • dedupwith
    • ls-with
    • show-with

Print-Codes is another example, which prompts for a serial number and then encodes it as a QR or barcode and prints it.

Clone this wiki locally