leds.c

gehe zur Dokumentation dieser Datei
00001 /****************************************************************************/
00027 /*****************************************************************************
00028 *                                                                            *
00029 *   This program is free software; you can redistribute it and/or modify     *
00030 *   it under the terms of the GNU General Public License as published by     *
00031 *   the Free Software Foundation; either version 2 of the License, or        *
00032 *   any later version.                                                       *
00033 *                                                                            *
00034 *****************************************************************************/
00035 #include "asuro.h"
00036 
00037 
00038 
00039 /****************************************************************************/
00068 inline void StatusLED (
00069   unsigned char color)
00070 {
00071   if (color == OFF)
00072   {
00073     GREEN_LED_OFF;
00074     RED_LED_OFF;
00075   }
00076   if (color == GREEN)
00077   {
00078     GREEN_LED_ON;
00079     RED_LED_OFF;
00080   }
00081   if (color == YELLOW)
00082   {
00083     GREEN_LED_ON;
00084     RED_LED_ON;
00085   }
00086   if (color == RED)
00087   {
00088     GREEN_LED_OFF;
00089     RED_LED_ON;
00090   }
00091 }
00092 
00093 
00094 
00095 /****************************************************************************/
00120 inline void FrontLED (
00121   unsigned char status)
00122 {
00123   PORTD = (PORTD &~(1 << PD6)) | (status << PD6);
00124 }
00125 
00126 
00127 
00128 /****************************************************************************/
00155 void BackLED (
00156   unsigned char left,
00157   unsigned char right)
00158 {
00159   if (left || right)
00160   {
00161     PORTD &= ~(1 << PD7);               // Rad-LED's OFF
00162     DDRC |= (1 << PC0) | (1 << PC1);    // Port als Output => KEINE Odometrie
00163     PORTC |= (1 << PC0) | (1 << PC1);
00164   }
00165   if (!left)
00166     PORTC &= ~(1 << PC1);
00167   if (!right)
00168     PORTC &= ~(1 << PC0);
00169 }

Erzeugt am Sun Nov 18 18:24:52 2007 für ASURO Library von  doxygen 1.5.1-p1