I have a microcontroller from based on an Evaluation Kit of Texas Instruments. There is a vibration motor which is being activated with following code:
handle = ClipPWM_open(PWMI_MOTOR, &pwm_params);
PWM_start(handle);
uint8_t intensity = 100;
PWM_setDuty(handle, intensity * 155)
(PWM.h reference TI)
My task is to develop a function which will activate the vibration motor and start from X and ends at Y. This is executed in a specified amount of ticks.
Firstly, I tried to enable the motor, set the intensity (e.g. 10), wait using a for loop until half of ticks were reached. After that I added the intensity setting to another value (e.g. 100) to wait again using a for loop.
This won't work. the intensity of 10 (the first) is being ignored and it only executes the intensity of 100.
I'm new to these topics. Do I have the wrong approach?