Created
August 5, 2012 11:24
-
-
Save anonymous/3263996 to your computer and use it in GitHub Desktop.
working
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "TimerOne.h" | |
#include "Arduino.h" | |
extern "C" { | |
#include "irmpconfig.h" | |
#include "irmp.h" | |
#include "irsndconfig.h" | |
#include "irsnd.h" | |
} | |
void setup() | |
{ | |
Serial.begin(115200); | |
pinMode(IRSND_BIT, OUTPUT); | |
irsnd_init(); | |
Timer1.initialize(1000000 / F_INTERRUPTS); | |
Timer1.attachInterrupt(timerinterrupt); | |
} | |
void loop() | |
{ | |
// 15:0:11:0 = Blaupunkt Grundig code | |
IRMP_DATA irmp_data; | |
irmp_data.protocol = IRMP_GRUNDIG_PROTOCOL; | |
irmp_data.address = 0x00; | |
irmp_data.command = 0x11; | |
irmp_data.flags = 0x00; | |
int result; | |
result = irsnd_send_data(&irmp_data, TRUE); | |
if (result != 1) Serial.println("ERROR"); | |
if (result == 1) Serial.println("Sent"); | |
delay(1500); | |
} | |
void timerinterrupt() | |
{ | |
uint8_t irsnd_is_on; | |
irsnd_ISR(&irsnd_is_on); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment