# Code Mode Rules ## ESP32/PlatformIO Specifics - Use `LEDC` peripheral for PWM on ESP32 (not analogWrite) - BTS7960 PWM frequency: 1-25kHz optimal, 20kHz recommended to reduce motor noise - Enable pins (R_EN, L_EN) must be HIGH before PWM signals work - Current sense pins (R_IS, L_IS) output analog voltage proportional to motor current