Exemplo n.º 1
0
int main ( void )
{
  init_print (); 
  int0_init ();
  
  initializeScheduler ();
  
  createTask ( &function_1, "fun_one", 1, 200 );
  
  createTask ( &function_2, "fun_two", 2, 200 );
  
  createTask ( &function_3, "fun_three", 3, 200 );
  
  createTask ( &function_4, "fun_four", 4, 50 );

  startScheduler ();
  
  return 0;
}
Exemplo n.º 2
0
void motor_init(void)
{
	// direction	
	sbi(DDRD, 4);
	sbi(DDRD, 4);

	// brake	
	sbi(DDRD, 5);
	sbi(PORTD, 5);
	
	motor_period = 0;
  
	int0_init();

	PWM_NG_TIMER_8BITS_INIT(2, TIMER_8_MODE_PWM, 
        	                 TIMER1_PRESCALER_DIV_256);
        
	PWM_NG_INIT8(&pwm, 2, 12, PWM_NG_MODE_NORMAL, NULL, 0);
	start_motor();
}