Требуется программист в Зеленограде
- обработка данных с датчиков; ColdFire; 40 тыс. e-mail:jobsmp@pochta.ru |
//*************************************************************************//
// LedBln.c //
// This is a LED chaser example program for the AVR STK500 starter kit //// valuation board. This program works for all AVRs. //
// ription: //
// This program will turn on the User LEDs one at a time and circulate //
// this procedure in a forever loop. //
//*************************************************************************//
// Include I/O definition file //
#include
#include
#include
//*************************************************************************//
// //
//*************************************************************************//
void main( void ) // //
{ // //
unsigned char led; // //
// // //
PORTB = 0; // Give PORTB an initial startvalue //
DDRB = 0xFF; // Set PORTB as output //
led = 1; // Start with LED0 = 1; //
//*************************************************************************//
// //
//*************************************************************************//
while(1) // Internal loop //
{ // //
PORTB = led; // Invert the output since a zero means: LED on
led <<= 1; // Move to next LED by performing a rotate left
// // //
if (!led) // //
led = 1; // If overflow: start with LED0 again //
// // //
__delay_cycles(5000); // Wait for 5000 cycles //
//
} // //
} // //
//*************************************************************************//