centering value for c/r servo?
baldi36
Posts: 6
·is the center value for c/r servo =(1.5*868)?
868 being based on the clock update speed for the javelin. or am i completely off base?
chris
868 being based on the clock update speed for the javelin. or am i completely off base?
chris
Comments
thanks
chris
// Program Listing 4.5 - Basic Servo Control
import stamp.core.*;
public class ServoControl {
· static PWM servo = new PWM(CPU.pin12,173,2304);
· public static void main() {
··· System.out.println("Welcome to Servo Control: ");
··· System.out.println(" r - right");
··· System.out.println(" l - left");
··· System.out.println(" c - center");
··· while (true) {
····· switch ( Terminal.getChar() ) {
····· case 'r':
······· servo.update(130,2304);
······· break;
····· case 'l':
······· servo.update(220,2304);
······· break;
····· case 'c':
······· servo.update(173,2304);
······· break;
····· }
··· }
· }
}
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
stupid me never got past the problem of the getChar() not reading in the value. (or not responding to the value, it would appear.) never occurred to me to fudge a value and see what the code did.
thanks again.
chris