[ create a new paste ] login | about

Link: http://codepad.org/YhhJXK0N    [ raw code | fork ]

C, pasted on Oct 16:
/**
 * \file
 *
 * \brief Empty user application template
 *
 */

/**
 * \mainpage User Application template doxygen documentation
 *
 * \par Empty user application template
 *
 * Bare minimum empty user application template
 *
 * \par Content
 *
 * -# Include the ASF header files (through asf.h)
 * -# Minimal main function that starts with a call to board_init()
 * -# "Insert application code here" comment
 *
 */

/*
 * Include header files for all drivers that have been imported from
 * Atmel Software Framework (ASF).
 */
#include <asf.h>
#include <util/delay.h>
int main (void)
{
	board_init();
	int x = 0;




	TCCR2B |= (1 << WGM22) | (1 << WGM20) | (1 << WGM21);
	TCCR2A |= (1 << COM2A1);
	
	OCR2B = 26;
	int dir = 0;
	DDRD |= (1 << PORTD3);
	TCCR2B |= (1 << CS22) | (1 << CS21) | (1 << CS20);
	
	
	
	
	PORTD |= (1 << PORTD3);
	
	

	
/
	for(x=0; x<= 5000; x++){
		_delay_ms(2000);
		
		dir ^= 1;
		
		switch(dir){
			case(0):
			OCR2B = 26;
			break;

			case(1):
				OCR2B = 12;
				break;
	
	}
	

	
	exit(1);
	}*/
}


Create a new paste based on this one


Comments: