fix period customizable

This commit is contained in:
2025-12-10 02:34:51 +09:00
parent 3d8b12c321
commit 457b415d61

View File

@@ -19,6 +19,8 @@ const float Kd = 600.0f;// D gain
#define BASE_SPEED 1500// Slower speed (approx 10% duty of 15000)
#define MAX_DRV 3000 // Max speed limit (20% duty)
#define PERIOD_MS 20
void main() {
Clock_Init48MHz();
ir_init();
@@ -113,7 +115,7 @@ void main() {
}
// F. Loop Delay (Sampling Time)
Clock_Delay1ms(2);
Clock_Delay1ms(PERIOD_MS);
}
finish: