go_away

Author Topic: I need some servo help.  (Read 1232 times)

0 Members and 1 Guest are viewing this topic.

Offline galannthegreatTopic starter

  • Supreme Robot
  • *****
  • Posts: 615
  • Helpful? 4
  • Blue-Lensed Blue LEDs?! What?! Impossible!!
I need some servo help.
« on: February 12, 2009, 08:57:02 PM »
I've got my servo panning back and forth, but it's not enough, I change for a longer delay and it doesn't change anything. What am I doing wrong?
Code: [Select]
#include "16f877a.h"
#use delay(clock=20000000)
#fuses HS


void main()
{

   setup_adc_ports(NO_ANALOGS);
   setup_adc(ADC_OFF);
   setup_psp(PSP_DISABLED);
   setup_spi(SPI_SS_DISABLED);
   setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
   setup_timer_1(T1_DISABLED);
   setup_timer_2(T2_DISABLED,0,1);
   setup_comparator(NC_NC_NC_NC);
   setup_vref(FALSE);

   while(1)
   {
   output_high(PIN_D0);
   delay_us(500);
   output_low(PIN_D0);
   delay_ms(1000);
   output_high(PIN_D0);
   delay_us(1500);
   output_low(PIN_D0);
   delay_ms(1000);
   output_high(PIN_D0);
   delay_us(2500);
   output_low(PIN_D0);
   delay_ms(1000);
   output_high(PIN_D0);
   delay_us(1500);
   output_low(PIN_D0);
   delay_ms(1000);
   }
   
}

PS I am using a PIC 16F877a and I'm writing the code in CCS C.
Kurt

Offline galannthegreatTopic starter

  • Supreme Robot
  • *****
  • Posts: 615
  • Helpful? 4
  • Blue-Lensed Blue LEDs?! What?! Impossible!!
Re: I need some servo help.
« Reply #1 on: February 12, 2009, 09:14:11 PM »
and wow, I must not be having a good day because this topic is in the wrong category, sorry for any troubles.
Kurt

Offline Hawaii00000

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 347
  • Helpful? 2
Re: I need some servo help.
« Reply #2 on: February 13, 2009, 08:12:18 PM »
If it doesn't rotate far enough it might be just the servo. How many degrees is it supposed to rotate?
"God chose to make the world according to very beautiful mathematics."
-Paul Dirac
**************************************************************
Its Hawaii Five-O. Get it?

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,702
  • Helpful? 173
    • Society of Robots
Re: I need some servo help.
« Reply #3 on: February 15, 2009, 09:05:38 PM »
Can you clarify exactly what it is actually doing, and what you want it to specifically do?

 


Get Your Ad Here