Permalink
Browse files

Init

  • Loading branch information...
0 parents commit 94553f2aa11b273795598e24f2cbfdd3185cf81e @dokipen committed Jun 1, 2012
Showing with 73 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +17 −0 Makefile
  3. +55 −0 scifair.ino
1 .gitignore
@@ -0,0 +1 @@
+build-cli/
17 Makefile
@@ -0,0 +1,17 @@
+ARDMK_DIR = ${HOME}/src/Arduino-Makefile
+BOARD_TAG = mega
+ARDUINO_DIR = /home/doki_pen/opt/arduino-1.0.1
+ARDUINO_PORT = /dev/ttyACM0
+AVRDUDE_ARD_PROGRAMMER = stk500v2
+AVRDUDE_ARD_BAUDRATE = 9600
+AVRDUDE_CONF = ${ARDUINO_DIR}/hardware/tools/avrdude.conf
+MONITOR_CMD = screen -RRad scifair
+AVR_TOOLS_DIR = ${ARDUINO_DIR}/hardware/tools/avr
+MCU = atmega2560
+VARIANT = mega
+F_CPU = 16000000
+
+include ${ARDMK_DIR}/arduino-mk/Arduino.mk
+
+unmonitor:
+ pkill -f "SCREEN -RRad scifair"
55 scifair.ino
@@ -0,0 +1,55 @@
+/*
+ Blink
+ Turns on an LED on for one second, then off for one second, repeatedly.
+
+ This example code is in the public domain.
+ */
+
+#define DOT 50
+#define DASH 200
+#define SLEEP 100
+// how long between letters
+#define SPACE 300
+// pin for LED
+#define LED 13
+
+void sig(int ms) {
+ digitalWrite(LED, HIGH);
+ delay(ms);
+ digitalWrite(LED, LOW);
+ delay(SLEEP);
+}
+
+void dot() { sig(DOT); }
+void dash() { sig(DASH); }
+
+void space() {
+ digitalWrite(LED, LOW); // set the LED off
+ delay(SPACE);
+}
+
+void s() {
+ for (int i = 0; i < 3; i++) {
+ dot();
+ }
+ space();
+}
+
+void o() {
+ for (int i = 0; i < 3; i++) {
+ dash();
+ }
+ space();
+}
+
+void setup() {
+ pinMode(LED, OUTPUT);
+ space(); space();
+ Serial.begin(9600);
+}
+
+void loop() {
+ Serial.println("hello");
+ s(); o(); s();
+ space();
+}

0 comments on commit 94553f2

Please sign in to comment.