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.
- Hello World
- Required Software
- Required Hardware (Arduino Uno, LED, Resistor)
- Assembly
- uLisp Flash
- 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)