Advertisement
Guest User

Untitled

a guest
Feb 26th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #include <ipst.h> // include file for IPST-SE
  2. int h=0,m=0,s=0,i=2;
  3. void setup()
  4. { setTextSize(2);
  5.   glcd(2,1,"STOPWATCH");
  6.   sw_OK_press();
  7.   glcdFillCircle(64,120,32,GLCD_WHITE);
  8.   glcdLine(64,120,85,141,GLCD_BLACK);
  9.   delay(500);
  10.   glcdClear();
  11. }
  12.  
  13. void loop()
  14. {
  15.   sleep(1000);
  16.   glcd(1,3,"%d:%d:%d ",h,m,s);
  17.   if(s == 60)
  18.   {
  19.     s = 0;
  20.     m++;
  21.   }
  22.   else
  23.   {
  24.     s++;
  25.   }
  26.   if(m == 60)
  27.   {
  28.      m = 0;
  29.      h++;
  30.   }
  31.   if(in(17) == false)
  32.   {
  33.     glcd(i,3,"LAP %d :%d:%d:%d ",i,h,m,s);
  34.     i++;
  35.   }
  36.   if(in(16) == false)
  37.   {
  38.     while(1)
  39.     {
  40.     }      
  41.   }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement