Permalink
Browse files

Got a simple program to say "Hello\n" every 2s, and then a simple lis…

…p file to read that out. Requires some weird `__cxa_pure_virtual` stuff so the avr-gcc compiler can deal with virtual methods used in the arduino base cpp files.

refs #1
  • Loading branch information...
1 parent 28b59f7 commit 7f815beab8eb99f1829cd47975cf2f63b9c8811d @ryepup committed Sep 28, 2009
Showing with 34 additions and 0 deletions.
  1. +2 −0 serial-repeater/Makefile
  2. +13 −0 serial-repeater/reader.lisp
  3. +19 −0 serial-repeater/serial-repeater.pde
View
2 serial-repeater/Makefile
@@ -0,0 +1,2 @@
+TARGET = serial-repeater
+include ../arduino.mk
View
13 serial-repeater/reader.lisp
@@ -0,0 +1,13 @@
+;;;; reader.lisp
+
+(defpackage #:serial-reader
+ (:use #:cl))
+
+(in-package #:serial-reader)
+
+(defun read-serial ()
+ (with-open-file (s "/dev/ttyUSB0"
+ :direction :io
+ :if-exists :overwrite)
+ (read-line s)))
+
View
19 serial-repeater/serial-repeater.pde
@@ -0,0 +1,19 @@
+// -*- mode: c -*-
+int ledPin = 13;
+int blinkMs = 2000;
+
+void setup(){
+ pinMode(ledPin, OUTPUT);
+ Serial.begin(9600);
+}
+
+void loop (){
+ digitalWrite(ledPin, HIGH);
+ Serial.println("Hello");
+ delay(blinkMs);
+ digitalWrite(ledPin, LOW);
+ delay(blinkMs);
+}
+
+extern "C" void __cxa_pure_virtual(void);
+void __cxa_pure_virtual(void) {}

0 comments on commit 7f815be

Please sign in to comment.