Proposed solution to serial buffer problems


#21

The problem is that the Arduino serial interface, that uLisp relies on, doesn’t implement flow control. So when you paste in a long listing, the information echoed to the terminal using serial write causes the serial read to miss characters sent on the stream.

As a solution, the semicolon character turns off echo to the terminal; this is explained here:

http://www.ulisp.com/show?3L#semicolon

A comment line turns off echo so that by starting a long listing with a comment, it can safely be pasted in to the Arduino IDE’s Serial Monitor without overflowing the serial buffer. Echo is turned back on automatically after a one second delay if there is no activity on the serial input.

Please try pasting in a listing starting with a comment line, prefixed by a semicolon, and I think that should solve the problem. For example:

; Test program

(defun sq (x) (* x x))

(defun led-off nil
  (digitalwrite :led-builtin nil))

(defun led-on nil
  (pinmode :led-builtin t)
  (digitalwrite :led-builtin t))

#22

Thanks David, It works perfectly.