9 years, 4 months ago.

pwm for juste 4 periods

good morning.

plz,can you give me the code for géneration of pwm for 4 periods?

thenks.

1 Answer

9 years, 4 months ago.

That will be difficult. How fast is the signal ? With some processors you can combine hardware timers to generate signals. But not with the normal pwm lib.

Accepted Answer

100Hz

posted by aklou M'hamed 02 Feb 2015

For 100Hz you can create the signal manually by setting a IO pin and using wait 4 times. If you don't want to block the cpu with waiting, you can use the RTOS and call to Thread::wait instead.

posted by Peter Drescher 02 Feb 2015