Rev 425 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 425 | Rev 438 | ||
---|---|---|---|
Line 46... | Line 46... | ||
46 | { |
46 | { |
47 | timer0_MM3(); // Kompass auslesen |
47 | timer0_MM3(); // Kompass auslesen |
Line 48... | Line 48... | ||
48 | 48 | ||
49 | if (!cntKompass--) // Aufruf mit 10 Hz |
49 | if (!cntKompass--) // Aufruf mit 10 Hz |
50 | { |
- | |
51 | int heading; |
50 | { |
52 | heading = heading_MM3(); |
- | |
53 | KompassValue = (KompassValue * 3 + heading) / 4; // Filtern |
51 | KompassValue = heading_MM3(); |
54 | KompassRichtung = ((540 + KompassValue - KompassStartwert) % 360) - 180; |
52 | KompassRichtung = ((540 + KompassValue - KompassStartwert) % 360) - 180; |
55 | cntKompass = 980; |
53 | cntKompass = 980; |
56 | } |
54 | } |
57 | } |
55 | } |