Motor Shield Example code for 2.74 Class @ MIT
Dependents: experiment_example motor_shield_example Lab3_experiment_example jumping_leg_clicky
Diff: HardwareSetup.cpp
- Revision:
- 3:2f46953e7c8b
- Parent:
- 2:30503be9a375
- Child:
- 5:d2dffc88e94d
--- a/HardwareSetup.cpp Wed Aug 26 00:24:51 2020 +0000 +++ b/HardwareSetup.cpp Wed Aug 26 02:43:57 2020 +0000 @@ -9,6 +9,7 @@ TIM_HandleTypeDef htim16; TIM_HandleTypeDef htim17; +int PWM_PERIOD; void SystemClock_Config(void); void HAL_TIM_MspPostInit(TIM_HandleTypeDef* htim); static void MX_TIM12_Init(void); @@ -18,7 +19,8 @@ static void MX_TIM16_Init(void); static void MX_TIM17_Init(void); -void initHardware(){ +void initHardware(int periodTicks){ + PWM_PERIOD = periodTicks; /* Initialise the HAL Layer */ HAL_Init();