Sending Lisp directly to an Arduino via the serial port


#1

Thanks to Alex Skornyakov for reporting that you can send Lisp functions to uLisp running on an Arduino directly via the serial port using powershell on a PC running Windows 7.

For this to work you first need to disable the auto reset on the Arduino board. Fortunately you can do this just by connecting a 220Ω resistor between the 5V and Reset pins on the header; see:

https://playground.arduino.cc/Main/DisablingAutoResetOnSerialConnection

You then just need to enter a command such as this at the command line:

powershell "$port= new-Object System.IO.Ports.SerialPort COM6,9600,None,8,one; $port.open(); $port.WriteLine('(dotimes (x 10) (digitalwrite 13 nil) (delay 1000) (digitalwrite 13 t) (delay 1000))'); start-sleep -m 50; $port.ReadExisting(); $port.Close()"

This will cause the LED on pin 13 to blink 10 times.

It should be possible to do something similar on a Mac from the Terminal; any suggestions?