Page 5 of 5

Posted: Fri Feb 04, 2011 9:18 pm
by ThePyroElectro

Code: Select all

   //The sample function, while not used, is a way of demonstrating autonomous movement.
            //The controller does not need to be plugged in while this function runs.
void sample(void)
{
init();

move(0,0,0xF400,0xF000,0);

Delay10KTCYx(250);
Delay10KTCYx(250);   //Wait 1 Second

move(0,0,0xEF77,0xF277,0); // GRIP!

Delay10KTCYx(250);
Delay10KTCYx(250);   //Wait 1 Second

move(0,0,0xEE00,0xF500,0);

Delay10KTCYx(250);
Delay10KTCYx(250);   //Wait 1 Second

move(0,0,0xEF77,0xF277,0);   //UNGRIP!

Delay10KTCYx(250);
Delay10KTCYx(250);   //Wait 1 Second

}


(1) The function first performs an initialization [init()]

(2) Then it moves two servos to a certain location [move()]

(3) Then it waits for 1 second using two delay functions [Delay10KTCYx()]

(4) It continues doing this 3 times, moving the gripper servos.

The move function, resets the location of the servo motor, which tells the servo to move to the new location.

Code: Select all

void move(int one,int two,int three,int four, int five)


It depends on which servo you want to move, you can move 0 to 5 since there are 5 servos to choose from. For example, if you want to move servos Two and Four to a new location:
move(0,0xF000,0,0xF000,0);


This would move both servos to location 0xF000. Putting 0 for all other servos, tells the function not to move those servos, leave them at their currently set location.

Posted: Sat Feb 05, 2011 3:49 am
by geekminator
Thanks, you are the best

Re: The Wooden Menace; Robotic Arm

Posted: Sun Jan 20, 2013 3:53 pm
by nosmer.kram
We're going to build this project.. we have the IC in hand. where would we start?? sgould we build the schematic first? or program the IC? thanks for the immediate reply

Re: The Wooden Menace; Robotic Arm

Posted: Wed Jan 23, 2013 6:48 pm
by ThePyroElectro
nosmer.kram wrote:We're going to build this project.. we have the IC in hand. where would we start?? sgould we build the schematic first? or program the IC? thanks for the immediate reply


Make sure you can program the IC. Then connect 1 servo motor to the microcontroller and make sure the servo motor is controlled by the microcontroller.

You need to make sure you understand how to load a program onto the microcontroller FIRST because you will need to do software debugging at some point, projects never work perfectly on the first try.

Re: The Wooden Menace; Robotic Arm

Posted: Wed Jan 30, 2013 2:43 am
by nosmer.kram
sir. we already programmed the IC using the code provided in the wooden menace... we also connect one servo on the IC. how do we test if the servo is being controlled by the IC???? and next thing we're having a hard time to figure out what is theconnection of the PS1 controller in the IC . thanks for your reply.

Re: The Wooden Menace; Robotic Arm

Posted: Wed Feb 06, 2013 10:41 pm
by ThePyroElectro
nosmer.kram wrote:sir. we already programmed the IC using the code provided in the wooden menace... we also connect one servo on the IC. how do we test if the servo is being controlled by the IC???? and next thing we're having a hard time to figure out what is theconnection of the PS1 controller in the IC . thanks for your reply.


Hello,

If the servo is being controlled by the IC, you will not be able to move it and it will hold its position. Alternatively, you can use an oscilloscope to check the output control signal voltage vs. time. The PS1 controller was a simple shift register common in most arcade controllers. You can look at the source code to see how the controller information was shifted out and then executed, or you can build your own controller code with something more simple like push buttons.

Re: The Wooden Menace; Robotic Arm

Posted: Wed Nov 06, 2013 7:53 pm
by johnnypal5
hi i need help with the code amm in a last question said change the code to use 4 buttons replacing the joystick but i cant do that so somebody can help me???? :shock: :shock: :shock: :shock: :?: :?: :?: :?: