by DarrenR on Tue Sep 23, 2008 5:25 pm
Hi Robin,
There is a way to do this, but it is not an actual function. I've attached a configuration with the setup in it. It uses two GP off/on channels assigned to Switch input 1 and 2. These two channels are combined in a channel math function of one minus the other, to give a result channel (GP 1) that is -1 when one button is pressed and 1 when the other button is pressed, otherwise it is 0.
This is then applied to one axis of a 3D table with the other axis being the count number (GP 2). The data in the table is arranged so the result of the table (GP 3) is the same as GP 1 unless the count is 0 or 10, this limits the count to the range.
Another Channel Maths is used to add GP 3 to GP 2 where GP 2 is also the result of the function, Basicly GP 2 = GP 2 + GP 3. To stop GP 2 from running away while a button is pressed, the condition to run the Channel Maths is 'GP 1 Changed by 1'. This gives an edge trigger so the maths is only calculated when the GP 1 value actually changes.
This can be done slightly different ways, with limits and count by values changed to suit your needs.
- Attachments
-
- CountUpDown.D45
- (234.42 KiB) Downloaded 1416 times
Darren Reynolds
MoTeC Research Centre - Melbourne, Australia.