Who's OnlineWe have 16 guests and 7 members online - Robotactor
- Sazabi
- 27Loco
- jdeenen
- i-Bot
- joao.silva
- SoBot
|
|
View previous topic :: View next topic
|
| Author |
Message |
Sazabi Savvy Roboteer

Joined: 07 Jan 2008 Posts: 68
|
Posted: Fri Feb 05, 2010 11:05 pm Post subject: Need help with HSR8498, plz |
|
|
That's me again)
I did everything I could imagine,but couldn't make servo move(
That's the code I used:
| Code: |
#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? |
|
| Back to top |
|
 |
Sazabi Savvy Roboteer

Joined: 07 Jan 2008 Posts: 68
|
Posted: Sat Feb 06, 2010 11:52 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
Sazabi Savvy Roboteer

Joined: 07 Jan 2008 Posts: 68
|
Posted: Sun Feb 07, 2010 8:55 pm Post subject: |
|
|
| Ok, never mind it. Solved) |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|
|