arduino+P3022霍尔传感器控制电机角度,代码报错过不了编译
//set timer4
TCCR4A = 0;
TCCR4B = 0;
TCNT4 = 0;
// Mode 10: phase correct PWM with ICR4 as Top (= F_CPU/2/25000)
// OC4A OC4B OC4C as Non-Inverted PWM output
ICR4 = (F_CPU/2000)/2;
TCCR4A =_BV(COM4A1) | _BV(COM4B1) | _BV(COM4C1) | _BV(WGM41);
TCCR4B = _BV(WGM43) | _BV(CS40);
'COM4A1' was not decared in this scope
前面加int声明
过编译能跑起来
报错代码发给我看看