ASURO Library
2.80
Hauptseite
Dateien
Auflistung der Dateien
Datei-Elemente
lib
leds.c
gehe zur Dokumentation dieser Datei
1
/****************************************************************************/
27
/*****************************************************************************
28
* *
29
* This program is free software; you can redistribute it and/or modify *
30
* it under the terms of the GNU General Public License as published by *
31
* the Free Software Foundation; either version 2 of the License, or *
32
* any later version. *
33
* *
34
*****************************************************************************/
35
#include "
asuro.h
"
36
37
38
39
/****************************************************************************/
68
void
StatusLED
(
69
unsigned
char
color)
70
{
71
if
(color ==
OFF
)
72
{
73
GREEN_LED_OFF
;
74
RED_LED_OFF
;
75
}
76
if
(color ==
GREEN
)
77
{
78
GREEN_LED_ON
;
79
RED_LED_OFF
;
80
}
81
if
(color ==
YELLOW
)
82
{
83
GREEN_LED_ON
;
84
RED_LED_ON
;
85
}
86
if
(color ==
RED
)
87
{
88
GREEN_LED_OFF
;
89
RED_LED_ON
;
90
}
91
}
92
93
94
95
/****************************************************************************/
120
void
FrontLED
(
121
unsigned
char
status)
122
{
123
PORTD = (PORTD &~(1 << PD6)) | (status << PD6);
124
}
125
126
127
128
/****************************************************************************/
155
void
BackLED
(
156
unsigned
char
left,
157
unsigned
char
right)
158
{
159
if
(left || right)
160
{
161
PORTD &= ~(1 << PD7);
// Rad-LED's OFF
162
DDRC |= (1 << PC0) | (1 << PC1);
// Port als Output => KEINE Odometrie
163
PORTC |= (1 << PC0) | (1 << PC1);
164
}
165
if
(!left)
166
PORTC &= ~(1 << PC1);
167
if
(!right)
168
PORTC &= ~(1 << PC0);
169
}
Erzeugt am Mit Nov 27 2013 22:55:08 für ASURO Library von
1.8.2