#include "asuro.h"
#include <stdlib.h>
gehe zum Quellcode dieser Datei
Funktionen | |
int | main (void) |
int main | ( | void | ) |
Definiert in Zeile 16 der Datei IRCollisionTest/test.c.
00017 { 00018 00019 unsigned char sw; 00020 00021 Init(); 00022 DDRD |= (1 << DDD1); // Port D1 als Ausgang 00023 PORTD &= ~(1 << PD1); // PD1 auf LOW 00024 00025 while (1) 00026 { 00027 if (PIND & (1 << PD0)) 00028 StatusLED(GREEN); 00029 else 00030 StatusLED(RED); 00031 00032 sw = PollSwitch(); 00033 if (sw & 0x01) 00034 OCR2 = 0xFE; //Pulsbreite 1 00035 if (sw & 0x02) 00036 OCR2 = 0xFD; //Pulsbreite 2 00037 if (sw & 0x04) 00038 OCR2 = 0xFB; //Pulsbreite 4 00039 if (sw & 0x08) 00040 OCR2 = 0xF7; //Pulsbreite 8 00041 if (sw & 0x10) 00042 OCR2 = 0xEF; //Pulsbreite 16 00043 if (sw & 0x20) 00044 OCR2 = 0x90; //Pulsbreite 110 00045 } 00046 return 0; 00047 }