Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <ipst.h> // include file for IPST-SE
- int h=0,m=0,s=0,i=2;
- void setup()
- { setTextSize(2);
- glcd(2,1,"STOPWATCH");
- sw_OK_press();
- glcdFillCircle(64,120,32,GLCD_WHITE);
- glcdLine(64,120,85,141,GLCD_BLACK);
- delay(500);
- glcdClear();
- }
- void loop()
- {
- sleep(1000);
- glcd(1,3,"%d:%d:%d ",h,m,s);
- if(s == 60)
- {
- s = 0;
- m++;
- }
- else
- {
- s++;
- }
- if(m == 60)
- {
- m = 0;
- h++;
- }
- if(in(17) == false)
- {
- glcd(i,3,"LAP %d :%d:%d:%d ",i,h,m,s);
- i++;
- }
- if(in(16) == false)
- {
- while(1)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement