05-30-2017 02:15 PM
No, I want the resistance be control. So We enter the initial value , & the amount to increase each time the loop runs and loop runs for T period ( I haven't added this part). Here is my code so far
05-30-2017 02:32 PM
Move the Resistance control outside the loop and wire it to the initiation for the shift register. Other than that I think you have the right idea. Clean up your wires - you can't see exactly where each wire leads and this can lead to subtle bugs. For example, looking at your code, in your false case check that what you are wiring to the output tunnel is correct. It looks like right now it is actually wired to Resistance To Add, which will make it reset to that number whenever the Up button is not on. I don't think that's what you want, though I'm not sure.
Also, why is the Up button a typedef? Did you do that on purpose because you are planning to customize it later? If not, you don't need it to be one.
05-30-2017 02:51 PM
For some reason my case structure never gets executed!
05-30-2017 02:57 PM
Why do you think it's never being executed?
05-30-2017 03:00 PM
When I run the program , resistance doesnt increase when I press the button.
05-30-2017 03:01 PM
That's because you are not writing to the Resistance from within the loop. I see you added a new indicator called New Resistance. That's perfect, just move it to inside the loop if you want it to update before the loop finishes.
05-30-2017 03:02 PM
Also, just to note, it increases very quickly since there is no wait in the loop. I would recommend adding a wait to the loop and/or looking at what altenbach said earlier about latching booleans.
05-30-2017 03:06 PM
This is with new value inside the loop..still nothing..
05-30-2017 03:13 PM
Sorry, I should have been more clear. You also need to wire it to where you want it to update from. So, use the wiring tool to click on the wire coming from the output tunnel of your case structure and into the output tunnel of the shift register. Wire this branched wire into your indicator.
05-30-2017 03:16 PM
Ahhh..I finally see something 🙂 One problem though..I want each time I push the button this iteration happens . Currently once the button is true it keeps adding until I turn off the button