#include "asuro.h"
#include <stdlib.h>
gehe zum Quellcode dieser Datei
Funktionen | |
void | InitIRDetect (void) |
void | InitUart (void) |
int | main (void) |
void InitIRDetect | ( | void | ) |
Definiert in Zeile 18 der Datei IRCollisionTest/test.c.
00019 { 00020 UCSRB = 0; 00021 DDRD |= (1 << DDD1); // Port D1 als Ausgang 00022 PORTD &= ~(1 << PD1); // PD1 auf LOW 00023 OCR2 = ocr2; 00024 }
void InitUart | ( | void | ) |
int main | ( | void | ) |
Definiert in Zeile 31 der Datei IRCollisionTest/test.c.
00032 { 00033 00034 unsigned char sw; 00035 00036 Init(); 00037 00038 DDRD |= (1 << DDD1); // Port D1 als Ausgang 00039 PORTD &= ~(1 << PD1); // PD1 auf LOW 00040 00041 // InitIRDetect(); 00042 while (1) 00043 { 00044 UCSRB = 0; 00045 OCR2 = 0xFE; 00046 00047 if (PIND & (1 << PD0)) 00048 StatusLED(GREEN); 00049 else 00050 StatusLED(RED); 00051 00052 sw = PollSwitch(); 00053 if (sw & 0x01) 00054 ocr2 = 0xFE; //Pulsbreite 1 00055 if (sw & 0x02) 00056 ocr2 = 0xFD; //Pulsbreite 2 00057 if (sw & 0x04) 00058 ocr2 = 0xFB; //Pulsbreite 4 00059 if (sw & 0x08) 00060 ocr2 = 0xF7; //Pulsbreite 8 00061 if (sw & 0x10) 00062 ocr2 = 0xEF; //Pulsbreite 16 00063 if (sw & 0x20) 00064 ocr2 = 0x90; //Pulsbreite 110 00065 00066 if (sw) 00067 { 00068 OCR2 = 0x91; 00069 PrintInt(sw); 00070 SerPrint(" "); 00071 PrintInt(ocr2); 00072 SerPrint("\r\n"); 00073 } 00074 // Msleep(100); 00075 } 00076 return 0; 00077 }