ubumenu + external switch

Apr 25, 2008 at 8:27pm

ubumenu + external switch

I’m trying to control a ubumenu using an external momentary push button switch that goes from 0->1->0 with one push. I’d like the button to scroll to the next option in the menu, then to the next one with another push, and so on.

I don’t know if it would be easier to use ubumenu or umenu, but I have more experience with ubumenu.

Any guidance would be appreciated.

#37245
Apr 25, 2008 at 8:46pm

You are probably looking for some combination of togedge and counter, I’d wager.

AB

#128550
Apr 26, 2008 at 6:33am

This is what I’ve come up with so far. But I can only re-initialize the settings, rather than go to the next one continuously.

max v2;
#N vpatcher 446 60 1072 844;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 246 204 27 196617 + 1;
#P newex 243 161 31 196617 == 1;
#P button 243 133 16 0;
#N counter;
#X flags 0 0;
#P newobj 244 102 66 196617 counter;
#P message 262 44 14 196617 0;
#P message 243 44 14 196617 1;
#P newex 243 75 46 196617 TogEdge;
#P user ubumenu 225 370 100 196617 0 1 1 0;
#X add happy;
#X add sad;
#X add glad;
#X add mad;
#X prefix_set 0 0 0;
#P user umenu 247 334 100 196647 1 64 350 1;
#X add 1. apple;
#X add 2. bannana;
#X add 3. celery;
#X add 4. dumplings;
#X add 5. eggplant;
#X add 6. french fries;
#X add 7. granola;
#X add 8. hummus;
#P newex 247 301 62 196617 prepend set;
#P number 243 271 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 50 186 31 196617 == 1;
#P user umenu 30 244 100 196647 1 64 260 1;
#X add 1. apple;
#X add 2. bannana;
#X add 3. celery;
#P button 50 166 15 0;
#N counter 5;
#X flags 0 0;
#P newobj 50 137 66 196617 counter 5;
#P message 69 77 14 196617 0;
#P message 50 77 14 196617 1;
#P newex 50 108 46 196617 TogEdge;
#P user ubumenu 50 215 100 196617 0 1 1 0;
#X add happy;
#X add sad;
#X add glad;
#X add mad;
#X prefix_set 0 0
0;
#P window linecount 2;
#P comment 35 39 84 196617 this patch only re-initializes.;
#P window linecount 3;
#P comment 261 227 100 196617 trying to the number to increase every time the bang is lit.;
#P connect 9 0 8 0;
#P connect 5 0 3 0;
#P connect 4 0 3 0;
#P connect 3 0 6 0;
#P connect 6 0 7 0;
#P connect 7 0 9 0;
#P connect 9 0 2 0;
#P connect 11 0 13 0;
#P connect 15 0 14 0;
#P connect 16 0 14 0;
#P connect 17 0 18 0;
#P connect 18 0 19 0;
#P connect 20 0 10 0;
#P connect 14 0 17 0;
#P connect 19 0 20 0;
#P connect 10 0 11 0;
#P connect 11 0 12 0;
#P pop;

#128551
Apr 26, 2008 at 7:09am

On Apr 25, 2008, at 1:27 PM, v1025kernel wrote:
> I’m trying to control a ubumenu using an external momentary push
> button switch that goes from 0->1->0 with one push. I’d like the
> button to scroll to the next option in the menu, then to the next
> one with another push, and so on.

Something like this?

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P comment 166 494 75 196617 button counter;
#P comment 155 429 87 196617 button simulation;
#P newex 108 454 32 196617 t 0 1;
#P button 108 430 15 0;
#N counter 4;
#X flags 0 0;
#P newobj 108 534 66 196617 counter 4;
#P newex 108 505 32 196617 sel 1;
#P user umenu 108 589 100 196647 1 64 605 1;
#X add 1. apple;
#X add 2. bannana;
#X add 3. celery;
#X add 4. avacado;
#X add 5. jalapeno;
#P user panel 96 424 148 56;
#X brgb 250 253 176;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 96 488 149 76;
#X brgb 250 253 176;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 4 0 2 0;
#P connect 3 0 4 0;
#P connect 5 0 6 0;
#P connect 6 0 3 0;
#P connect 6 1 3 0;
#P window clipboard copycount 9;

Chris Muir
cbm@well.com

http://www.xfade.com

#128552

You must be logged in to reply to this topic.