summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2012-03-23 03:18:37 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2012-03-23 03:18:37 +0100
commitfe0622e85f1382597498053e6f0826cbaf2e4f3e (patch)
tree70d380ecf570822c7137ade8bb30226209606f8f
parent6a072ffc96fb16b44bf21e9b4e4ae9e2b64f78f6 (diff)
downloadonkyo-ri-master.tar.gz
onkyo-ri-master.tar.xz
onkyo-ri-master.zip
port for arduino 1.0HEADmaster
-rw-r--r--Makefile6
-rw-r--r--onkyo_ri.ino (renamed from onkyo_ri.pde)12
2 files changed, 10 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 9d6ff3c..7d470e4 100644
--- a/Makefile
+++ b/Makefile
@@ -6,11 +6,7 @@ ARDUINO_PORT = /dev/ttyUSB0
AVRDUDE_ARD_PROGRAMMER = stk500v1
AVRDUDE_MCU= m168
-ARDUINO_DIR = /usr/share/arduino-0017/
-
-# arduino < 0018
-BOARDS_TXT = $(ARDUINO_DIR)/hardware/boards.txt
-ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/cores/arduino
+ARDUINO_DIR = /usr/share/arduino-1.0/
# linux
AVR_TOOLS_PATH = /usr/bin/
diff --git a/onkyo_ri.pde b/onkyo_ri.ino
index 4ce88c2..b2152e5 100644
--- a/onkyo_ri.pde
+++ b/onkyo_ri.ino
@@ -12,6 +12,7 @@ MD = 71808
*/
#include "signals.h"
+//#include <SoftwareSerial.h>
// Digital pin #2 is the same as Pin D2 see
// http://arduino.cc/en/Hacking/PinMapping168 for the 'raw' pin mapping
@@ -22,7 +23,7 @@ MD = 71808
#define MAXPULSE 500
#define RESOLUTION 20
-#define FUZZINESS 20
+#define FUZZINESS 50
uint8_t raw[2];
@@ -30,6 +31,8 @@ uint64_t listenForIR(ir_t *proto);
int getPulseLength();
int getPulseLengthInRange(int expected);
+//SoftwareSerial wdlive_serial(11, 12);
+
void sendToggle(int pin, int delayTime[]) {
digitalWrite(pin, LOW);
delayMicroseconds(delayTime[0] * 10);
@@ -70,8 +73,11 @@ void send(ir_t *proto, uint64_t value, int pin, bool inverted) {
void setup(void) {
Serial.begin(9600);
Serial.println("Ready to decode IR!");
- pinMode(8, OUTPUT);
+// wdlive_serial.begin(115200);
+// wdlive_serial.println("irinject down");
+
+ pinMode(8, OUTPUT);
digitalWrite(8, HIGH);
}
@@ -88,7 +94,7 @@ void findKey(ir_map_t *ir_map, uint8_t count, uint64_t code) {
void loop(void) {
uint64_t code = listenForIR(&onkyo);
- Serial.println(code, HEX);
+ Serial.println((long unsigned int)code, HEX);
findKey(ir_map, ARRAY_LEN(ir_map), code);
}