I find this now:
...
#elif defined NyBoard_V1_0
byte pins[] = {12, 11, 3, 4,
13, 10, 5, 2,
14, 9, 6, 1,
15, 8, 7, 0
};
#define BATT A7
#define LOW_BATT 640
#define DEVICE_ADDRESS 0x54
#define BAUD_RATE 115200
//define PIXEL_PIN 10
#endif
cut ... and this:
#define PIN 0 // 16 byte array
#define CALIB 16 // 16 byte array
#define MID_SHIFT 32 // 16 byte array
#define ROTATION_DIRECTION 48 // 16 byte array
#define SERVO_ANGLE_RANGE 64 // 16 byte array
#define MPUCALIB 80 // 16 byte array
#define FAST 96 // 16 byte array
#define SLOW 112 // 16 byte array
#define LEFT 128 // 16 byte array
#define RIGHT 144 // 16 byte array
cut ... and this:
//servo constants
#define DOF 16
#define PWM_FACTOR 4
#define MG92B_MIN 170*PWM_FACTOR
#define MG92B_MAX 550*PWM_FACTOR
#define MG92B_RANGE 150
#define MG90D_MIN 158*PWM_FACTOR //so mg92b and mg90 are not centered at the same signal
#define MG90D_MAX 515*PWM_FACTOR
#define MG90D_RANGE 150
#define P1S_MIN 180*PWM_FACTOR
#define P1S_MAX 620*PWM_FACTOR
#define P1S_RANGE 250
cut ... and this:
// Depending on your servo make, the pulse width min and max may vary, you
// want these to be as small/large as possible without hitting the hard stop
// for max range. You'll have to tweak them as necessary to match the servos you
// have!
#ifdef P1S
#define SERVOMIN P1S_MIN // this is the 'minimum' pulse length count (out of 4096)
#define SERVOMAX P1S_MAX // this is the 'maximum' pulse length count (out of 4096)
#define SERVO_ANG_RANGE P1S_RANGE
#else
#define SERVOMIN MG92B_MIN // this is the 'minimum' pulse length count (out of 4096)
#define SERVOMAX MG92B_MAX // this is the 'maximum' pulse length count (out of 4096)
#define SERVO_ANG_RANGE MG92B_RANGE
#endif
#define PWM_RANGE (SERVOMAX - SERVOMIN)
Its a little bit tricky for me. ;)
Witch defines must i change to use my MG99R Servos for they don't tilt so mutch? :D
I find this from comment from Rongzhong Li:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The regular range of servos should be 500~2500.
We multiplied a PWM_FACTOR of 4. You may need to remove the *PWM_FACTOR if you use 771~2193.
Every servo is different even in the same batch. It's always good to benchmark the servo by yourself.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I will test it ;)
I change this:
#define PWM_FACTOR 1 // 4
and this:
#define P1S_MIN 650 //180*PWM_FACTOR
#define P1S_MAX 2350 //620*PWM_FACTOR
#define P1S_RANGE 270 //250
Why do you make this in OpenCat.ino?
pwm.setPWMFreq(60 * PWM_FACTOR); // Analog servos run at ~60 Hz updates
It means that frequence is 240 Hz when factor is 4