Table of Contents

1 Lisping Hel-LED-o World

With a single LED and a single resistor, we can HELLO WORLD our arduino with a flashing LED. Of course I am no embedded programmer so I recoile at using C. Luckily there are other embedded languages available to the Arduino Uno, which I happen to be using.

  1. Hello World
  2. Required Software
  3. Required Hardware (Arduino Uno, LED, Resistor)
  4. Assembly
  5. uLisp Flash
  6. Code Upload via Serial

2 1.0 Required Software

For this I will be using Arduino Studio, tio, uLisp.

3 2. Required Hardware

  • Arduino Uno
  • USB A MALE CABLE
  • 22K RESISTOR
  • LED

4 3 Assembly

GPIO.13 –> 22K –> LED –> GND

5 4 µLisp Flash

1.1. Open Arduino Studio 1.2. Copy ulisp.ino into Arduino Studio 1.3. Upload

2 Code Upload Via Seria

tio -b9600 /dev/ttyACM0

Your serial device may be different from mine ttyACM0. Use Arduino Studios Auto Detection to find your Arduino.

;; is-prime? -> bool
(defun pri (n)
  (let ((d 2))
    (loop
     (when (> (* d d) n) (return t))
     (when (zerop (mod n d)) (return nil))
     (incf d))))

;; prime-blink-led-pin -> nil
(defun bli (pin)
  (pinmode pin t)
  (dotimes (x 32767)
    (when (and (> x 1) (pri x))
      (dotimes (f (* x 2))
        (digitalwrite pin (evenp f))
        (delay 250))))
  '())

;; led-n-times-between-dly-ms -> nil
(defun alt (pin n dly)
  (pinmode pin t)
  (dotimes (x (* 2 n) )
    (digitalwrite pin (evenp x))
    (delay dly))
  (delay dly)
  '())

;; alternate-blink-n-times-delayed -> nil
(defun ald (pin n dly)
  (pinmode pin t)
  (dotimes (x (* 2 n))
     (delay dly))
  '())


(ald 13 20 100)

Author: me

Created: 2020-01-20 Mon 13:55

Validate