Difference between revisions of "CSC270 Final Exam 2012"

From dftwiki3
Jump to: navigation, search
Line 57: Line 57:
  
 
int READY_TO_START = 0;
 
int READY_TO_START = 0;
 +
int SENDING = 1;
 
char ch = 'A';
 
char ch = 'A';
 
int state = -1; // uninitialized
 
int state = -1; // uninitialized
Line 99: Line 100:
 
     return;
 
     return;
 
      
 
      
 +
  state = SENDING;
 +
 
   // if character we're about to send is 'A' turn LED on
 
   // if character we're about to send is 'A' turn LED on
 
   if ( ch == 'A' )
 
   if ( ch == 'A' )
Line 125: Line 128:
  
 
   // wait 1/2 second before sending new char
 
   // wait 1/2 second before sending new char
   delay( 5000 );
+
   delay( 500 );
 +
 
 +
  // next char in alphabet
 +
  ch = ch + 1;
 +
  if ( ch > 'Z' ) ch = 'A';
 +
 
 
   state = READY_TO_START;
 
   state = READY_TO_START;
 
}
 
}

Revision as of 08:05, 1 May 2012

--D. Thiebaut 23:04, 25 April 2012 (EDT)



...