Last change
on this file since 87 was
87,
checked in by sven, 11 years ago
|
Implementierung und Testen des Geraetes und neusten Spielplans im Musem am Di 10.09.2013.
|
File size:
783 bytes
|
Line | |
---|
1 | /* |
---|
2 | * Magnetic_Tape_Show.c |
---|
3 | * |
---|
4 | * Created: 10.08.2013 13:52:32 |
---|
5 | * Author: Sven |
---|
6 | */ |
---|
7 | |
---|
8 | #include <avr/io.h> |
---|
9 | #include "wiring.h" |
---|
10 | #include "pseudosprache.h" |
---|
11 | |
---|
12 | void Initialize() { |
---|
13 | // Ports einrichten |
---|
14 | // PORTxn setzten DDRxn Pull-Up-Widerstaende |
---|
15 | PORTA = 0x00; |
---|
16 | PORTB = 0x01; // LED Pull up |
---|
17 | PORTC = 0x00; |
---|
18 | PORTD = 0x00; |
---|
19 | |
---|
20 | DDRA = 0xFF; // Relais 1-8, Register voll belegt als Output |
---|
21 | DDRB = 0x00 | (1 << DDB0); // LED Output |
---|
22 | DDRC = 0xFF; // Relais 9-13, Register nicht voll belegt *TODO* |
---|
23 | DDRD = 0x00 | (1 << DDD3) | (1 << DDD4); // Relais 16, 17 |
---|
24 | |
---|
25 | // jetzt mit Werten belegen, Default: Alle Relais sind aus! |
---|
26 | PORTA = 0xFF; |
---|
27 | PORTC = 0xFF; |
---|
28 | PORTD = 0xFF; |
---|
29 | } |
---|
30 | |
---|
31 | int main(void) { |
---|
32 | Initialize(); |
---|
33 | while(1) { |
---|
34 | if(is_button()) { |
---|
35 | abspielen(); |
---|
36 | } |
---|
37 | } |
---|
38 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.