Hi,
I made this little program,
I asked this in another thread but I wasnt abel to do this.
My problem is that I would like to change the PWM Signals when an Input (pushbutton is pressed) is done.
If switch "left" is pressed the left PWM (output left) should be around 30% duty cycle and hold for one second.
If switch "right" is pressed the right PWM (output right) should be around 30% duty cycle and hold for one second.
At the moment the duty cycle is only changed during the pushbutton is pressed. How can I change this the best way?
It must also work that when pshbutton left is pressed output left must change the duty cycle for one second, but when within 1 second bushbutto right is presses also the right must change the duty cycle for one second.
it sounds like multitasking for me and I dont know how to do this.
Another thing is I would like to activate the OC2 (third PWM) on my Atmega8. do I need to use a C Code for this?
Thanks
control PWM duty cycle with input (hold input for time) Atm
Moderator: Benj
control PWM duty cycle with input (hold input for time) Atm
- Attachments
-
- control_PWM.fcf_avr
- (11.5 KiB) Downloaded 234 times
- DavidA
- Matrix Staff
- Posts: 1076
- Joined: Fri Apr 23, 2010 2:18 pm
- Location: Matrix Multimedia Ltd
- Has thanked: 58 times
- Been thanked: 258 times
- Contact:
Re: control PWM duty cycle with input (hold input for time)
Hi HMS,
Since you are posting a Flowcode V4 program, i will move this topic to the Flowcode V4 forums, if you cannot access the V4 forums then you will need to follow an additional step to get your forum account upgraded.
This link will help you: http://www.matrixmultimedia.com/support ... f=29&t=602
Since you are posting a Flowcode V4 program, i will move this topic to the Flowcode V4 forums, if you cannot access the V4 forums then you will need to follow an additional step to get your forum account upgraded.
This link will help you: http://www.matrixmultimedia.com/support ... f=29&t=602
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: control PWM duty cycle with input (hold input for time)
Hello,
The simulation is a bit slow but this should work correctly on the hardware to give you around 1 second delays.
The simulation is a bit slow but this should work correctly on the hardware to give you around 1 second delays.
- Attachments
-
- control_PWM.fcf_avr
- (11 KiB) Downloaded 244 times
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel