diff --git a/.gitignore b/.gitignore index 6da247f..ed909fe 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ /postgresql/tutorial/weather/data/ +/arduino/arduino.mk +.dep +*.hex diff --git a/arduino/.env b/arduino/.env new file mode 100644 index 0000000..7de2088 --- /dev/null +++ b/arduino/.env @@ -0,0 +1,2 @@ +export ARDUINODIR=~/opt/arduino-1.0.5 +export BOARD=uno diff --git a/arduino/HelloWorld/HelloWorld.ino b/arduino/HelloWorld/HelloWorld.ino index 2914d9b..ce2d2f6 100644 --- a/arduino/HelloWorld/HelloWorld.ino +++ b/arduino/HelloWorld/HelloWorld.ino @@ -1,6 +1,16 @@ const unsigned int LED_PIN = 13; -const unsigned int PAUSE = 500; -const unsigned int FLASH_DURATION = 50; +const unsigned int PAUSE = 700; +const unsigned int FLASH_DURATION = 100; + + +void flash(int n) { + for (int i = 0; i < n; i++) { + digitalWrite(LED_PIN, HIGH); + delay(FLASH_DURATION); + digitalWrite(LED_PIN, LOW); + delay(FLASH_DURATION); + } +} void setup() { @@ -15,13 +25,3 @@ void loop() { } delay(PAUSE); } - - -void flash(int n) { - for (int i = 0; i < n; i++) { - digitalWrite(LED_PIN, HIGH); - delay(FLASH_DURATION); - digitalWrite(LED_PIN, LOW); - delay(FLASH_DURATION); - } -} diff --git a/arduino/HelloWorld/Makefile b/arduino/HelloWorld/Makefile new file mode 120000 index 0000000..51c7f30 --- /dev/null +++ b/arduino/HelloWorld/Makefile @@ -0,0 +1 @@ +../arduino.mk \ No newline at end of file diff --git a/arduino/Makefile b/arduino/Makefile new file mode 120000 index 0000000..868c6f3 --- /dev/null +++ b/arduino/Makefile @@ -0,0 +1 @@ +arduino.mk \ No newline at end of file diff --git a/arduino/setup b/arduino/setup new file mode 100755 index 0000000..2e2c7c5 --- /dev/null +++ b/arduino/setup @@ -0,0 +1,5 @@ +#!/bin/bash +set -e + +cd $(dirname "$BASH_SOURCE") +curl -L -O -s http://ed.am/dev/make/arduino-mk/arduino.mk