Given the ability to invoke primitives via a serial interface, then from a PC you can:
test the native mcu code (e.g. new primitives/drivers/custom code)
develop/test Lua application code
test the hardware (the problem isn't always the software!)
To run this example...
$make BOARD=adafruit-itsybitsy-m4
$make BOARD=adafruit-itsybitsy-m4 flash
If you have built and flashed successfully, LED0 will blink 10 times (see main.lua) and then turn off.
At this point, you can turn LED0 on or off from a PC using a simple terminal emulator. I use picocom as in this example (your tty port may vary)...
$ picocom /dev/ttyACM0
picocom v3.1
...
Terminal ready
At this point, the serial interface on the board is waiting for input. The following 2 commands will turn LED0 on and off (see serial protocol):
> u1 u1 c24D (turn on)
> u1 u0 c24C (turn off)
Enter those commands one at a time. Follow each command by a carriage return. The commands you enter will not be echoed to the terminal.
If you have entered the command correctly, the target responds with the following to indicate that the command has been received correctly and the LED should turn on/off:
> t c155
You can also make the LED blink automatically. This command ("blink.count=100") makes the LED blink 100 times:
> u2 u1 b626C696E6B2E636F756E743D313030 c962
Again, if the command was received correctly, the mcu responds as follows:
> t c155
While the LED is blinking, you can change the duty cycle. This command ("blink.duty=0.05") changes the duty cycle to 5%:
> u2 u1 b626C696E6B2E647574793D302E3035 c957
Again, if the command was received correctly, the mcu responds as follows:
> t c155
The following command command ("blink.count=1e7") will make the LED blink 10,000,000 times:
> u2 u1 b626C696E6B2E636F756E743D316537 c971
Although you can send these commands from a dumb terminal, they are really intended to be sent from a program running on the PC.
navigate to pc-apps/blinky.serial-service