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

Need help with HSR8498, plz

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

Need help with HSR8498, plz

Post by Sazabi » Sat Feb 06, 2010 12:05 am

Post by Sazabi
Sat Feb 06, 2010 12:05 am

That's me again)
I did everything I could imagine,but couldn't make servo move(
That's the code I used:
Code: Select all
#include "stdafx.h"
#include "rcservo.h"
#include "roboard.h"

int _tmain(int argc, _TCHAR* argv[])
{
   if (rcservo_Initialize(RCSERVO_USECHANNEL0))
   {
      printf("Channels 0 initialized");
      rcservo_EnterCaptureMode();
      rcservo_SetServo(0, RCSERVO_HITEC_HSR8498);
      unsigned long pos = rcservo_ReadPosition(0,0);
      unsigned long motion[32]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
      motion[1]=2300;
      rcservo_EnterPlayMode();
      rcservo_SetAction (motion, 500);
      while (rcservo_PlayAction() != RCSERVO_PLAYEND)
      {
      }
      rcservo_EnterPWMMode();
      unsigned long PWM_period = 10000;
      unsigned long PWM_duty = 1700;
      unsigned long count = 100;
      rcservo_SendPWMPulses(0, PWM_period, PWM_duty, count);
      while(!rcservo_IsPWMCompleted(0))
      {
      }
      rcservo_Close();
   }
   return 0;
}


At the end of this sode I receive this:
channels 0 initialized ( that's programmed by me)
Warning! rcservo_readPositions_PlayMode() fails to read channel 0! (and this appears everytime I try to use PlayMode).
When I try to use RoboRC.exe, it says channels can't be raed. No Idea why.
I use 2 pcs of 7.4V Li-Pos, total of 4Amp/h, HSR8498 does support 7.4V.
What could be the problem?
That's me again)
I did everything I could imagine,but couldn't make servo move(
That's the code I used:
Code: Select all
#include "stdafx.h"
#include "rcservo.h"
#include "roboard.h"

int _tmain(int argc, _TCHAR* argv[])
{
   if (rcservo_Initialize(RCSERVO_USECHANNEL0))
   {
      printf("Channels 0 initialized");
      rcservo_EnterCaptureMode();
      rcservo_SetServo(0, RCSERVO_HITEC_HSR8498);
      unsigned long pos = rcservo_ReadPosition(0,0);
      unsigned long motion[32]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
      motion[1]=2300;
      rcservo_EnterPlayMode();
      rcservo_SetAction (motion, 500);
      while (rcservo_PlayAction() != RCSERVO_PLAYEND)
      {
      }
      rcservo_EnterPWMMode();
      unsigned long PWM_period = 10000;
      unsigned long PWM_duty = 1700;
      unsigned long count = 100;
      rcservo_SendPWMPulses(0, PWM_period, PWM_duty, count);
      while(!rcservo_IsPWMCompleted(0))
      {
      }
      rcservo_Close();
   }
   return 0;
}


At the end of this sode I receive this:
channels 0 initialized ( that's programmed by me)
Warning! rcservo_readPositions_PlayMode() fails to read channel 0! (and this appears everytime I try to use PlayMode).
When I try to use RoboRC.exe, it says channels can't be raed. No Idea why.
I use 2 pcs of 7.4V Li-Pos, total of 4Amp/h, HSR8498 does support 7.4V.
What could be the problem?
Sazabi
Savvy Roboteer
Savvy Roboteer
Posts: 73
Joined: Mon Jan 07, 2008 8:57 am

Post by Sazabi » Sat Feb 06, 2010 12:52 pm

Post by Sazabi
Sat Feb 06, 2010 12:52 pm

Tried romayiii's code from another thread - got the same error "rcservo_readPositions_PlayMode() fails to read channel 0!". If I comment "rcservo_EnterPlayMode();" no error appear, but nothing else happens.
Tried romayiii's code from another thread - got the same error "rcservo_readPositions_PlayMode() fails to read channel 0!". If I comment "rcservo_EnterPlayMode();" no error appear, but nothing else happens.
Sazabi
Savvy Roboteer
Savvy Roboteer
Posts: 73
Joined: Mon Jan 07, 2008 8:57 am

Post by Sazabi » Sun Feb 07, 2010 9:55 pm

Post by Sazabi
Sun Feb 07, 2010 9:55 pm

Ok, never mind it. Solved)
Ok, never mind it. Solved)
Sazabi
Savvy Roboteer
Savvy Roboteer
Posts: 73
Joined: Mon Jan 07, 2008 8:57 am


3 postsPage 1 of 1
3 postsPage 1 of 1