HAllo! Bitte lüncht mich nicht :-) Der Simulator springt bei mir einfach nicht in das if (lader<245) was kann denn da sein, versteh i echt net...
1 | #include <stdlib.h> |
2 | #include <stdint.h> |
3 | #include <avr/io.h> |
4 | #include <avr/interrupt.h> |
5 | #include <avr/delay.h> |
6 | |
7 | extern void init_io(void); |
8 | extern void init_timer0(void); |
9 | |
10 | ISR(TIMER0_OVF0_vect); |
11 | |
12 | /*-------------
|
13 | *Pin-Belegung:
|
14 | * PortA:
|
15 | * Pin0: LED 1
|
16 | * Pin1: LED 2
|
17 | * Pin2: LED 3
|
18 | * Pin3: LED 4
|
19 | * Pin4: LED 5
|
20 | * Pin5: LED 6
|
21 | * Pin6: LED 7
|
22 | * PortB:
|
23 | * Pin0: LED 8
|
24 | * Pin1: LED 9
|
25 | * Pin2: Transistor 1
|
26 | * Pin3: Transistor 2
|
27 | * Pin4: Transistor 3
|
28 | * Pin5: Transistor 4
|
29 | * Pin6: Taster 1
|
30 | * Pin7: Taster 2
|
31 | */
|
32 | |
33 | int ledgruppe=4; |
34 | int lader=0; |
35 | |
36 | //----
|
37 | //MAIN
|
38 | //----
|
39 | int main(void) |
40 | {
|
41 | |
42 | PORTA=1; |
43 | cli(); |
44 | init_io(); |
45 | init_timer0(); |
46 | sei(); |
47 | |
48 | while (1) |
49 | {
|
50 | if (!(PINB & (1<<PINB6))) |
51 | {
|
52 | if (lader < 245) // !!!!!hier springt er net rein |
53 | {
|
54 | lader=lader+10; |
55 | }
|
56 | }
|
57 | }
|
58 | }
|