I have this programm written:
but the time will be not blink every 1 seconds.
Do you have an idea??
- include "mbed.h"
Serial pc(USBTX, USBRX);
Timer timer;
void DecodeInput(char input);
int main()
{
char input = 'Z';
pc.printf("Start the timer with: 1\r\n");
pc.printf("Stop your time with: 2\r\n");
pc.printf("Reset your Timer with: 3\r\n");
pc.printf("\r\n");
pc.printf("\r\n");
while(1){
input = pc.getc();
DecodeInput(input);
}
}
void DecodeInput(char input)
{
switch(input)
{
case '1': timer.start();
pc.printf("Start at:%f Sek\r\n\n", timer.read());
break;
case '2':
timer.stop();
pc.printf("your time: %f Sek\r\n\n", timer.read());
timer.start();
break;
case '3': timer.reset();
pc.printf("Your Stoptimer will be resetet\n\n\r");
}
}
Hi there,
i will programming a simple Stop watch.
With the Button "s" the time begin up to start -> Min, sec, Milli sec.
With the Button "B" the time stopped.
With the button "C" the time will be reset.
i am a beginner programmer.
all of this schould be screening on the Pc with Tera Term.
Can you help me??
Thanks