|
是 328P 喔。
好久远前的事儿了,记得有管脚被改动:
// A0
#define SERVO_1_PINMODE pinMode(A0,OUTPUT); // TILT_PITCH - WING left
#define SERVO_1_PIN_HIGH PORTC |= 1<<0;
#define SERVO_1_PIN_LOW PORTC &= ~(1<<0);
// A1
#define SERVO_2_PINMODE pinMode(A1,OUTPUT); // TILT_ROLL - WING right
#define SERVO_2_PIN_HIGH PORTC |= 1<<1;
#define SERVO_2_PIN_LOW PORTC &= ~(1<<1);
// A2
#define SERVO_3_PINMODE pinMode(A2,OUTPUT); // CAM TRIG - alt TILT_PITCH
#define SERVO_3_PIN_HIGH PORTC |= 1<<2;
#define SERVO_3_PIN_LOW PORTC &= ~(1<<2);
// D12(PB4) -> D4(PD4)
#define SERVO_4_PINMODE pinMode(4,OUTPUT); // new - alt TILT_ROLL
#define SERVO_4_PIN_HIGH PORTD |= 1<<4;
#define SERVO_4_PIN_LOW PORTD &= ~(1<<4);
// D11(PB3) -> D5(PD5)
#define SERVO_5_PINMODE pinMode(5,OUTPUT); // BI LEFT
#define SERVO_5_PIN_HIGH PORTD |= 1<<5;
#define SERVO_5_PIN_LOW PORTD &= ~(1<<5);
// D3
#define SERVO_6_PINMODE pinMode(3,OUTPUT); // TRI REAR - BI RIGHT
#define SERVO_6_PIN_HIGH PORTD|= 1<<3;
#define SERVO_6_PIN_LOW PORTD &= ~(1<<3);
// D10
#define SERVO_7_PINMODE pinMode(10,OUTPUT); // new
#define SERVO_7_PIN_HIGH PORTB |= 1<<2;
#define SERVO_7_PIN_LOW PORTB &= ~(1<<2);
// D9
#define SERVO_8_PINMODE pinMode(9,OUTPUT); // new
#define SERVO_8_PIN_HIGH PORTB |= 1<<1;
#define SERVO_8_PIN_LOW PORTB &= ~(1<<1);
|
|