implement motor driver

This commit is contained in:
2021-03-10 14:30:34 +01:00
parent 46e97a4a00
commit 96c1ef6699
4 changed files with 178 additions and 3 deletions
+7 -3
View File
@@ -16,8 +16,12 @@
#define FORWARD 1
#define BACKWARD 2
//PWM Configs
#define PWM_FREQ 5000
//MotorControl config
#define PWM_FREQ 16000
#define PWM_RES 8
#define PWM_CHANNEL_M1 0
#define PWM_CHANNEL_M2 1
#define PWM_CHANNEL_M2 1
#define UPDATE_TIME 25
#define SPEED_STEPS 5 // A total of 20 levels ( 100 / SPEED_STEPS ) * UPDATE_TIME = 500ms
#define PWM_MIN 40
#define PWM_MAX 245 // Max 98% of 2^PWM_RES