stopWatch

stopWatch - * =0/ unsignedshortintmin/elapsedminutes...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Some elements of a possible stop watch implementation. .. /* Global variables relating to the timer and stop watch */ unsigned short int timer=0;  //count interrupts from TimerB0 unsigned short int min;      // elapsed minutes unsigned short int sec;      // elapsed seconds  unsigned short int msec;     // elapsed 1/100 seconds  unsigned short int tdir;     // Direction of timer                               // 1=up, 0=down ... void main(void) {   WDTCTL = WDTPW + WDTHOLD;   // Stop watchdog timer     init_sys();                 // Initialize the MSP430   shortDelay(5);   _BIS_SR(GIE);               // Global Interrupt enable   while(1)   {     chkBtns();      clearLCD();     disptime();              if(BTN1)     {       stoptimerb(1);         // reset timer     }     if(BTN2)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/27/2008 for the course ECE 2801 taught by Professor Jarvis during the Fall '08 term at WPI.

Page1 / 3

stopWatch - * =0/ unsignedshortintmin/elapsedminutes...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online