Control servo using propeller GCC IDE
bhaskarghsh4
Posts: 20
Hello every body,
I am new in this forum. Without taking any time in formalities I would like to share the problem with me.
I am new in propeller micro controller also. My basic aim is to rotate servo with propeller BOE. I did it with spin using the objects related to servo that is required. But now I want to do the same task with propeller GCC ID using simple C program.
I used the program which follows:
#include "simpletools.h"
int main()
{
int servo = 19,inc=700;
/*servo_setramp(servo,100);*/
servo_angle(servo,900);
/* servo_speed(servo,100);*/
while(1)
{
servo_set(servo,inc++);/*To run continuously in manner instead of an instantaneous degree*/
}
return 0;
}
......
But the problem that the IDE is showing is that "Undefined reference to the function" (like servo_angle & servo_set) ...
I am in deep frustration. I tried different ways but couldn't sort out any way.
My another problem is to control the servo not by the propeller BOE pins itself but by using an intermediate PSCU controlled by propeller BOE through the 3 serial in pin using spin or C for propeller.
Thank you in advance for every one to give an effort to sort a way out to help me .....
I am new in this forum. Without taking any time in formalities I would like to share the problem with me.
I am new in propeller micro controller also. My basic aim is to rotate servo with propeller BOE. I did it with spin using the objects related to servo that is required. But now I want to do the same task with propeller GCC ID using simple C program.
I used the program which follows:
#include "simpletools.h"
int main()
{
int servo = 19,inc=700;
/*servo_setramp(servo,100);*/
servo_angle(servo,900);
/* servo_speed(servo,100);*/
while(1)
{
servo_set(servo,inc++);/*To run continuously in manner instead of an instantaneous degree*/
}
return 0;
}
......
But the problem that the IDE is showing is that "Undefined reference to the function" (like servo_angle & servo_set) ...
I am in deep frustration. I tried different ways but couldn't sort out any way.
My another problem is to control the servo not by the propeller BOE pins itself but by using an intermediate PSCU controlled by propeller BOE through the 3 serial in pin using spin or C for propeller.
Thank you in advance for every one to give an effort to sort a way out to help me .....
Comments
To control the PSCU you can use a serial library, and follow the command set that's found in the PSCU documentation.
2) Open the folder Motor
3) Click libservo and click Select Folder button.
4) You should have #include "servo.h" in your main program now.
5) Click hammer to compile.
Best Regards,
--Steve
Any way I got one of my answer. Thanks once again for that.
But my second query was about to control the servos through an intermediate PSCU from propeller BOE using this IDE or spin anything?
Best Regards,
--Bhaskar
[/QUOTE]
I still am not able to control servos through PSCU controlled by propeller BOE using serial in pins of PSCU. So kindly help my dear friends.
https://code.google.com/p/propsource/source/browse/Development/PSCU_test.spin?r=ee93adc619f0b19ddee6e262b17878417db9081f
& the most irritating thing is that I am using P19 of BOE to control but when I am connecting PSCU to any other pins also then same outcome occurs.
Even I tried a code in my way after studying the class servocontrollerserial but no fruitful result
The code is :
{
Want to rotate my servo through PSCU & propeller BOE using PSCU's serial in connection pin
}
CON
_clkmode = xtal1 + pll16x
_clkfreq = 80_000_000
PSCU_PIN = 0 'the pin on the host propeller that the PSCU is connected to.
PSCU_BAUD = 2_400
P19=19 ' Want to communicate through P19 of propeller BOE with PSCU
OBJ
servo: "ServoControllerSerial"
time: "timing"
PUB pscu_servo | P19_pos, P19_ramp
servo.start(PSCU_PIN,PSCU_BAUD)
P19_pos := 600
P19_ramp := 20
repeat 10
servo.setpos(P19,P19_ramp,P19_pos)
time.pause(2000)
P19_pos := 1600
servo.setpos(P19,P19_ramp,P19_pos)
time.pause(2000)
P19_pos := 600
Hello friends...
I still don't get answer.
Is there any other alternative way for solving my issue with PSCU?
Please help me to eradicate this problem from my mind ...