Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 4924

stuck with interrupt timer to control a servo

$
0
0
Hi all im trying to control a servo using the timer interrupt. so when the 20ms interrrupt occurs a counter is incremented which sets the servo at a specific position which does happen however, i want it to change position when the second counter increments but this is not working... can any one help?

my code:
Code (Text):
  1. unsigned int count, Adcval;
  2. unsigned int a =2000;
  3.  
  4. //Timer0
  5. //Prescaler 1:256; TMR0 Preload = 100; Actual Interrupt Time : 19.968 ms
  6.  
  7. //Place/Copy this part in declaration...
stuck with interrupt timer to control a servo

Viewing all articles
Browse latest Browse all 4924

Trending Articles