stoppuhr s
Dependencies: PinDetect TextLCD mbed
Fork of FeuerwehrStoppuhr0805 by
Diff: main.cpp
- Revision:
- 4:8c274febf3b0
- Parent:
- 3:6f6ee868bf8c
- Child:
- 5:9772a9e2c7e9
--- a/main.cpp Wed May 08 13:59:35 2013 +0000 +++ b/main.cpp Tue May 21 08:47:20 2013 +0000 @@ -22,7 +22,7 @@ int volatile sblock=0; int volatile reset=0; int volatile D=0; -//int volatile send=0; + int ms; int sec; int min; @@ -36,19 +36,12 @@ void empfangen() { // Note: you need to actually read from the serial to clear the RX interrupt - // send = 1; t.stop(); - if(sblock==1) - { - lcd.cls(); - lcd.printf("RESET: START LANGE DRUEKEN!"); - wait(1); - } pc.printf("Gesamtzeit: %s\n", buffer); pc.printf("Zwischenzeit: %s\n", zwischenzeit); pc.printf("Zwischenzeit: %s\n", zwischenzeit1); sblock=1; - lcd.printf("%c\n", hm.getc()); + lcd.printf("%c\n", hm.getc()); // um RX Interrupt zu löschen, Zeichen auslesen return; } @@ -56,7 +49,7 @@ { config = 0; enable = 0; - hm.printf("AA FA F0"); + hm.printf("AA FA F0"); //Standardkonfiguration laden wait(0.1); config = 1; return; @@ -119,7 +112,7 @@ else { lcd.cls(); - // wait(0.05); + lcd.locate(1, 0); if(sblock==0) { @@ -131,48 +124,25 @@ { lcd.printf("RESET: START LANGE DRUEKEN!"); wait(1); - } + } } resetcnt=resetcnt++; } -/* -// Callback routine is interrupt activated by a debounced pb2 hit -void pb2_hit_callback (void) { - t.stop(); - if(sblock==1) - { - lcd.cls(); -// wait(0.05); - lcd.printf("RESET: START LANGE DRUEKEN!"); - wait(1); - } - pc.printf("Gesamtzeit: %s\n", buffer); - pc.printf("Zwischenzeit: %s\n", zwischenzeit); - pc.printf("Zwischenzeit: %s\n", zwischenzeit1); - sblock=1; -} -*/ + int main() { - konfiguration(); + konfiguration(); hm.attach(&empfangen); // Setup Interrupt callback functions for a pb hit pb1.attach_deasserted(&pb1_hit_callback); - pb1.attach_deasserted_held(&reset_halten); - // pb2.attach_deasserted(&pb2_hit_callback); - + pb1.attach_deasserted_held(&reset_halten); // Start sampling pb inputs using interrupts pb1.setSampleFrequency(); - // pb2.setSampleFrequency(); - while (1) { wait(.1); lcd.cls(); - // if(send=1){ - - //} myled = !myled; // LED1 blickt stoppuhr(); //rufe Funktion stoppuhr auf lcd.locate(0, 0); //setze den curser auf Zeihen 0 Reihe 1