Installing minicom. To work with this from the shell, install a terminal emulator called minicom. It works like a charm on GNU/Linux system. To install this, give the command:
[stextbox id=”grey”]$ sudo apt-get install minicom[/stextbox]
There is a need to configure the minicom session with the following: baud rate: 115200, eight data bits, parity none, one stop bit using following command:
[stextbox id=”grey”]$ sudo minicom -s[/stextbox]
Now we are able to talk to our MCU via minicom. Search for the device in /dev. In our case, the device is in /dev/ttyACM0. Confirm the registration by doing a dmesg on your GNU/Linux.
Enter following command:
[stextbox id=”grey”]$ sudo minicom -D /dev/ttyACM0[/stextbox]
With this, we are actually communicating with our MCU in serial over USB mode.
Enter few commands like ls or cat and see your shell.
You can fire PicoLisp session like this:
[stextbox id=”grey”]Hempl# picolisp[/stextbox]
You can write PicoLisp interactively.
The other option is to invoke PicoLisp with a file argument stored in the micro-SD memory card. In this example, we have stored the source codes in the memory card in .l formats (led.l and timer1.l). The SD card is then inserted into the slot provided on Mizar32 board.
To run toggle_LED code led.l, give the following command:
[stextbox id=”grey”]Hempl# picolisp /mmc/led.l[/stextbox]
To see output, press the user button (SW2). The blue LED light on the board will glow and will go off when you release the button. Next, open the minicom and run the reaction timer code (timer1.l) and give the command:
[stextbox id=”grey”]Hempl# picolisp /mmc/timer1.l[/stextbox]
After getting the : symbol, type the following:
Please note the parenthesis. It is the syntax used to invoke Lisp function defined in timer1.l.
As soon as you run timer1.l, press any key on the keyboard. Time displayed on the terminal is the recorded time for showing how fast your hand is. You can press the key as many times as you would like and the corresponding time will be displayed on the terminal.
Download source code: click here
Do you like this article? You may also like: click here
Raman Gopalan is a volunteer programmer at SimpleMachines, Italy, and is currently hacking on PicoLisp for the Mizar32 computer