remrc / Self-Balancing-Cube

280 stars 64 forks source link

Question about PWM coding #10

Closed EagleYK closed 3 months ago

EagleYK commented 3 months ago

Hi, I saw in the code below you put 255-pwm as final results. Does it mean Nidec motor sets lower PWM but getting high motor speed?

pwmSet(PWM1_CH, sp > 255 ? 255 : 255 - sp); THX a lot.

remrc commented 3 months ago

Nidec PWM is inverse.

EagleYK commented 3 months ago

Nidec PWM is inverse.

Thanks a lot it really helps.