Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

rcservo help

Based on DMP's Vortex processor / SoC this board is a full computer capable of running a standard Windows and Linux installation on the backpack of your robot.
3 postsPage 1 of 1
3 postsPage 1 of 1

rcservo help

Post by swift » Thu Mar 25, 2010 9:22 pm

Post by swift
Thu Mar 25, 2010 9:22 pm

Hopefully this is obvious to someone.

I cannot generate a PWM.
Here is the code I borrowed from comds
Code: Select all
#include <stdio>
#include <iostream>
#include <windows>
#include <roboard>
#include <iostream>
#include "stdafx.h"
#include "rcservo.h"


using namespace System;

unsigned long PWM_period = 10000L;
unsigned long PWM_duty = 1500L;
unsigned long count = 100L;


int main()
{
   

   
if(rcservo_Initialize(RCSERVO_USECHANNEL1))
{      

   rcservo_EnterPWMMode();
   

   rcservo_SendPWMPulses(int(1), PWM_period, PWM_duty, count);
   
   
   rcservo_Close();
   
}
else
{
   return 1;   
}
   return 0;
}


I am completely new to programming, I can't even get cout to work :oops:.
Anyway I always get an exit code of 1, and all of the dll's that load say "no symbols loaded" with the exception of winio.dll that says "Binary was not built with debug information."
I have the bias for pwm rather than gpio, I just don't know what's going on here....

I can post the entire output log if anybody wants it, but this post is probably long enough already.
Hopefully this is obvious to someone.

I cannot generate a PWM.
Here is the code I borrowed from comds
Code: Select all
#include <stdio>
#include <iostream>
#include <windows>
#include <roboard>
#include <iostream>
#include "stdafx.h"
#include "rcservo.h"


using namespace System;

unsigned long PWM_period = 10000L;
unsigned long PWM_duty = 1500L;
unsigned long count = 100L;


int main()
{
   

   
if(rcservo_Initialize(RCSERVO_USECHANNEL1))
{      

   rcservo_EnterPWMMode();
   

   rcservo_SendPWMPulses(int(1), PWM_period, PWM_duty, count);
   
   
   rcservo_Close();
   
}
else
{
   return 1;   
}
   return 0;
}


I am completely new to programming, I can't even get cout to work :oops:.
Anyway I always get an exit code of 1, and all of the dll's that load say "no symbols loaded" with the exception of winio.dll that says "Binary was not built with debug information."
I have the bias for pwm rather than gpio, I just don't know what's going on here....

I can post the entire output log if anybody wants it, but this post is probably long enough already.
swift
Newbie
Newbie
Posts: 6
Joined: Sun Mar 14, 2010 3:02 am

Post by swift » Fri Mar 26, 2010 7:48 pm

Post by swift
Fri Mar 26, 2010 7:48 pm

It's only been a day, but I still can't get a servo to move.

Here's some new code that doesn't work.
Code: Select all
#include <stdio>
#include <iostream>
#include <windows>
#include <roboard_dll>
#include "stdafx.h"
#include "rcservo.h"


using namespace System;




int main()
{
rcservo_SetServo(0,RCSERVO_SERVO_DEFAULT_NOFB);
Console::WriteLine("Setting Up Servo Type \n");
   
if(rcservo_Initialize(RCSERVO_USECHANNEL0))
{
      rcservo_EnterPWMMode();
         Console::WriteLine("Entering PWM Mode");
      
      if(rcservo_SendPWMPulses(0, 10000L, 1500L, 100L))
      {
         Console::WriteLine("Something Should Be Moving \n");
      }
      else
      {
         Console::WriteLine("Failed To Send Pulses \n");
      }
}
   else
   {
   Console::WriteLine("Failed To Initialize Rcservo");
   }
return 0;
}


I have no idea what's not working, I'm using hs645mg's, I reset the bios to GPIO with the switch set to pull up, I set up VS 2005 according to the manual, code runs fine, always returns false at rcservo_Initialize, servo does not move.
It's only been a day, but I still can't get a servo to move.

Here's some new code that doesn't work.
Code: Select all
#include <stdio>
#include <iostream>
#include <windows>
#include <roboard_dll>
#include "stdafx.h"
#include "rcservo.h"


using namespace System;




int main()
{
rcservo_SetServo(0,RCSERVO_SERVO_DEFAULT_NOFB);
Console::WriteLine("Setting Up Servo Type \n");
   
if(rcservo_Initialize(RCSERVO_USECHANNEL0))
{
      rcservo_EnterPWMMode();
         Console::WriteLine("Entering PWM Mode");
      
      if(rcservo_SendPWMPulses(0, 10000L, 1500L, 100L))
      {
         Console::WriteLine("Something Should Be Moving \n");
      }
      else
      {
         Console::WriteLine("Failed To Send Pulses \n");
      }
}
   else
   {
   Console::WriteLine("Failed To Initialize Rcservo");
   }
return 0;
}


I have no idea what's not working, I'm using hs645mg's, I reset the bios to GPIO with the switch set to pull up, I set up VS 2005 according to the manual, code runs fine, always returns false at rcservo_Initialize, servo does not move.
swift
Newbie
Newbie
Posts: 6
Joined: Sun Mar 14, 2010 3:02 am

Post by swift » Sat Mar 27, 2010 2:12 am

Post by swift
Sat Mar 27, 2010 2:12 am

SUCCESS :lol: .... winio.vxd was corrupted, re-extracted and placed in application directory
SUCCESS :lol: .... winio.vxd was corrupted, re-extracted and placed in application directory
swift
Newbie
Newbie
Posts: 6
Joined: Sun Mar 14, 2010 3:02 am


3 postsPage 1 of 1
3 postsPage 1 of 1