12-10-2020 05:55 AM
Hi,
I have a project I am working on and everything is finished the only thing I have left is that I need to add a button (or switch) to stop/activate the PWM. I feel like I have tried everything, case structor around everything inside the while loop, case structor around the LED, now I am trying to solve it with a select block but it seems like all it is doing is slowing down the LED for a bit. Any advice?
Best Regards,
Nick
12-10-2020 09:33 AM
Okey, I am not sure how to remove the question but I solved it
12-10-2020 10:17 AM
12-10-2020 10:25 AM
Thanks, for the answer.
So I used a selector block which I spoke of before but instead of connecting a button I used a switch.
In the file you can se how I did it.
Best,
Carl
12-10-2020 11:12 AM - edited 12-10-2020 11:15 AM
@Nicklabview wrote:
In the file you can se how I did it.
Now you want to simplify your code. Is it way more complicated than in should be.
12-10-2020 11:47 AM
You might want to re-think the entire approach and use a loop with a fixed loop time and just toggle based percentage. With your design, you can easily get into log wait where the controls can react very slowly to user interactions.
Here's a "literal translation" of your code to give you some ideas about the points I made above, but you should really redesign it from scratch.