This video is for very beginners without code explanation. I have made another video about this topic with bit more details in video no - 70 in this channel kzbin.info/www/bejne/nZCYk2aYpryXmJI
@ulyssecordier2 жыл бұрын
It works very well. Thanks for this tutorial. I subscribed in case you make new videos, you stopped for 4 months, it's a shame. I hope you will be able to resume because I love your work. Best wishes !
@vigneshwaransaminathan64183 жыл бұрын
Superb Sir! Really Helpful.
@NizarMohideen3 жыл бұрын
Glad to hear that
@DS-ls7ck3 жыл бұрын
Thanks a lot. It is really simple. How can I make pwm with adjustable frequency and duty cycle?
@NizarMohideen3 жыл бұрын
In this example I wanted to have 100Hz with 0-100% variable duty cycle. How I did is: Clock frequency = 8000000Hz I divided it by 128 (prescaler) and then divided it again 625 (Counter period) to get 100Hz Follow this to get different frequency as you wish. I am adjusting duty cycle on the fly using __HAL_TIM_SET_COMPARE in the for loop from 0 (0%) - 625 (100%)( Counter period) Note : prescaler is always one less 128 is 128-1 =127
@NizarMohideen3 жыл бұрын
If you want to set the frequency on the fly you can use __HAL_TIM_SET_AUTORELOAD as I did in video kzbin.info/www/bejne/sKiUnoSLfpemia8
@LabSkaterPussies2 жыл бұрын
@@NizarMohideen isn't it the other way around? The prescaler is the same but the counter period is -1 because it starts at 0?
@NizarMohideen2 жыл бұрын
You can use other way round, it will generate pwm. But the counter period needs to be more than 1 (one) in order to have variable pulse width from 0-100%
@matovupaul4942 Жыл бұрын
You setting the prescaler and ARR but you don't even explain why you using those values
@ultralaggerREV12 ай бұрын
What would i change in the code to make it blink instead of fade?
@NizarMohideen2 ай бұрын
Set Pin PA1 as GPIO_Output as shown in kzbin.info/www/bejne/oYnKZWlto7uXlaM for Pin PC13 then on for 500 milliseconds as off for 500 milliseconds HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1, 1); HAL_Delay(500); HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1, 0); HAL_Delay(500);
@BechirZalila3 жыл бұрын
Very good work. Thank you!
@NizarMohideen3 жыл бұрын
Glad you liked it!
@kenz0292 Жыл бұрын
Why My led just blink, cant fade... When i connect led to 3.3v voltage it can on
@andrey__shintar2 жыл бұрын
Why i can't use this code with L293 motor shield? I've been trying to control the speed of DC motor 3V-6V. Please, help
@NizarMohideen2 жыл бұрын
Hi Andrey, I don’t have L293 with me. I have done L298N motor control in video no 20 in this channel. I hope it gives you a stepping stone
@andrey__shintar2 жыл бұрын
@@NizarMohideen Hi Nizar, thanks! I will watch it and try
@xlalbuquerque97053 жыл бұрын
I'm looking for the library to PHOTO SENSOR VEML6040 RGBW 16-BITS I2C, I would like to know where I can find the libraries to use in CubeIDE. Could you please help me? thank you so much, yours videos are helping me a lot.
@NizarMohideen3 жыл бұрын
I am sorry I don’t have VEML6040 with me at the moment.
@구승모-j1t3 жыл бұрын
What is doing __HAL_TIM_SET_COMPARE() Functions?
@NizarMohideen3 жыл бұрын
Hi there, Since we set Configuration → Parameter Settings → Counter Period 625, we can change Pulse from 0 to 625. 0 being 0% and 625 being 100% pulse width. __HAL_TIM_SET_COMPARE() is a macro to set the pulse on the fly.