Hallo, habe folgendes Problem im folgendem Beispiel das er nur den Wert
1 hochzählt, bzw 4eckige Käschen dartstellt beim Wert2 garnichts macht.
Komme einfach nicht weiter.
UART defekt?
if(!(PINA & (zaehler1)))
{
PORTC |=(LED1);
wert1++;
uart_puts( dtostrf( wert1, 1,0,string );
uart_puts(";");
while(!(PINA & (zaehler2)));
}
else
{
PORTC &=~(LED2);
}
if(!(PINA & (zaehler2)))
{
PORTC |=(LED2);
wert2++;
uart_puts( dtostrf( wert2, 1,0,string );
uart_puts(";");
while(!(PINA & (zaehler2)));
}
else
{
PORTC &=~(LED2);
}
1 | if(!(PINA & (zaehler1))) { |
2 | PORTC |= (LED1); |
3 | wert1++; |
4 | uart_puts( dtostrf(wert1, 1, 0, string) ); |
5 | uart_puts(";"); |
6 | while(!(PINA & (zaehler2))); // <========== zaehler2 ??? |
7 | } else { |
8 | PORTC &= ~(LED2); |
9 | }
|
10 | |
11 | if(!(PINA & (zaehler2))) { |
12 | PORTC |= (LED2); |
13 | wert2++; |
14 | uart_puts( dtostrf(wert2, 1, 0, string) ); |
15 | uart_puts(";"); |
16 | while(!(PINA & (zaehler2))); |
17 | } else { |
18 | PORTC &= ~(LED2); |
19 | }
|
if(!(PINA & (zaehler1))) {
PORTC |= (LED1);
wert1++;
uart_puts( dtostrf(wert1, 1, 0, string) );
uart_puts(";");
while(!(PINA & (zaehler1)));//---> das passt schon falsch kopiert
} else {
PORTC &= ~(LED1);
}
if(!(PINA & (zaehler2))) {
PORTC |= (LED2);
wert2++;
uart_puts( dtostrf(wert2, 1, 0, string) );
uart_puts(";");
while(!(PINA & (zaehler2)));
} else {
PORTC &= ~(LED2);
}
Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.