13.3.2 RPi-Spark CLI interface (standard input, CLI batch)

Using the RPi-Spark CLI interface to execute only one task at a time through command line arguments. When you need to handle multiple tasks it be cumbersome. At this time we can build a command list then send it to RPi-Spark CLI through the standard input, let it execute in turn.

The task list file is in JSON format and its structure is as follows:

{
    "board":"rpi_spark_v110",
    "cmd_list":
    [
        {"cmd":"device", "params":{"device":"dsp", "act":"ON"} },
        {"cmd":"device", "params":{"device":"dsp", "act":"clear"} },
        {"cmd":"device", "params":{"device":"dsp", "act":"refresh"} },
        {"cmd":"draw", "params":{"shape":"circle", "x":64, "y":32, "r":45, "fill":0, "outline":1} },
        ......
    ]
}

At this time, we introduced the commands supported by the RPi-Spark CLI interface. In the next section we created a smile animation application using these standard commands.

NOTE The RPi-Spark CLI interface does not implement sound play back operations.


 

Was this article helpful?

YES     |     NO

 

Enjoying the project? Spotted a mistake? Any opinions on the website? Let us know!