1962Re: [bestinc] programming problems
- Oct 16, 2013Cameron,
As noted on other posts, you should get 120° of rotation under program control.
On the hardware side, try swapping in another servo, check that your batteries (robot and joystick) and all the connections.
For a software test, load a simple program that steps the servo with just a time delay:
Inside the While(1) loop:
Build and run the program. It should step the servo full left, center and full right with a 1 second pause between positions.
If this doesn't work, try it on a different motor channel. You might have a bad channel on your Cortex.
On 10/16/2013 5:20 PM, Cameron Newbold wrote:I am from the killdeer school and don't worry about giving to much information i can usually follow just fine. when i tried to do this the servo started to respond but it wouldn't move any more that about 10 degrees or so and it was moving very rapidly between the 10 or so degrees and its original position. Do you know how to fix this?
On Tuesday, October 15, 2013 8:33 PM, Michael Blazer <mblazer@...> wrote:
Have you tried compiling and downloading the default program? (It's available here.) This lets you test all your Cortex motor channels and several of the Joystick functions. Once you can do this, you can start your own program.
Start simple. Use a Joystick to control a Servo.
1. Connect a Servo to the Cortex Motor channel 2 (using the servo adapter cable).
2. Start EasyC.
3. Click on "New Standalone Project" and select "Joystick Project (WiFi)"
3. Expand "Program Flow" and drag "While Loop" over and drop it under "Variables"
4. Enter 1 in the dialog box and hit Enter.
- All programs must have a master WHILE loop. The "While (1)" causes the program to run continuously until you shut the power off. Without this, your program runs once and then stops.
5. Under "Joystick" drag "Joystick to Servo" into the While loop. Leave the Joystick and Channel set to 1, set the Motor to 2 and hit Enter
- This programs the Cortex to take the position of the Right joystick, left-right position and sets the servo to match.
6. Make sure you have the programming cable connected to the joystick and that the Cortex and Joystick are properly linked
7. Click on the "Build and Download" menu and select "Build and Download F7". When you get the message that "The HEX file was successfully built", click Yes. When the Terminal tab is displayed, your program has been successfully downloaded. (You can close the Loader window)
8. You now should be able to control the servo with the joystick. (You may need to disconnect the programming cable)
Let us know if this works or if you're still having trouble.
P.S. What school and hub are you with?
(Sorry if this is too much info, it might help others)
On 10/15/2013 8:32 PM, cameron_newbold@... wrote:i am having problems where the motors and servos wont respond properly to the programming. what do i do?
- << Previous post in topic Next post in topic >>