I am using my gameduino2 as a "console" for my robot. I want to input motor speed values using vertical sliders, but I want the tracking value to increase going from the bottom up rather than top down. In the vertical orientation, is there a way to place the zero value at the bottom rather than the top?
Thanks for the quick reply! I already tried that, and yes the value can be inverted by subtracting from 65535, but the slider follows the cmd_track value. I connected the modified value to a gauge, and it looks good but the slider doesn't (ie they move in opposite directions). What I need is a widget to set variables (like desired speed). Left to right will work, of course, but it is not a natural as low to high for increasing numbers. Also, is there a toggle that is bistable (ie only on or off). I am using button widgets, but the "bounce" make them a little difficult to control.
Thanks for the hints. I was unable to get the slider to work with that idea. I could get the values shown by the slider button to move from low to high with the slider button tracking correctly, but only when the actual motion of my finger was from high to low! I have switched them back to horizontal in the interface. The debouncing hint was very useful as it was simpler than my version and seems to work better. With that approach, I can simply use rectangles with tags, and get a very nice "radio button" which changes colors to indicate status. I had very little luck making cmd_bgcolor do anything I could understand with widgets. A quick note, which you are no doubt already aware of, is that the pdf book I got as part of the kickstarter reward says the GD.input.tag is 255 when there is not touch, instead of 0.
Hi James, Sorry for the delay in replying. I have resolved the sliders issue by simply using the sliders in horizontal orientation. Your example above which changes the range value does not work as the slider passes the midpoint (range becomes smaller than the value), and setting the value by subtracting it from 65535 does work in terms of the display of the slider button, but the finger press must still be from high to low to generate the increasing value. I think the library would have to be modified to make a vertical slider with values that increase as the motion goes up.
I am using NilRTOS to do the GDswap() every 50 ms, which gives a fluid display rate, does a good job of "debouncing" and also conserves lots of cycles to communicate with the main processor (I am using the GD2 as a console device on a robot). Probably not fast enough for a game, but works good for a bunch of switches and gauges.