Minimote Select Case bug perhaps


#1

1) Give a description of the problem
Can;t get the value for the button that’s pressed on a Minimote

2) What is the expected behavior?
Select statement should resolve button #

3) What is happening/not happening?
Variable from device not being populated with button number. I do get presses/held and total # of buttons reported.
numberofbuttons variable should be numberofbutton (no “s”) and return the button pressed

17/10/2017, 12:09:23 +623ms
+1ms ╔Received event [Brewing].button = pushed with a delay of 76ms
+83ms ║RunTime Analysis CS > 16ms > PS > 38ms > PE > 30ms > CE
+92ms ║Runtime (40637 bytes) successfully initialized in 38ms (v0.2.0fa.20171011) (89ms)
+93ms ║╔Execution stage started
+109ms ║║Evaluating switch with values [[i::4183e9a9d415ad25cd94b65d4f866063::numButtons, v:[t:string, v:4, d::4183e9a9d415ad25cd94b65d4f866063:, a:numButtons, i:[], x:false, vt:string]]]
+113ms ║║Comparison (string) 4 is (integer) 1 = false (2ms)
+117ms ║║Comparison (string) 4 is (integer) 2 = false (1ms)
+120ms ║║Cancelling statement #23’s schedules…
+130ms ║║Executed virtual command log (1ms)
+139ms ║║pushed
+139ms ║║Executed virtual command log (1ms)
+147ms ║║INACTIVE
+148ms ║║Executed virtual command log (1ms)
+157ms ║║4
+157ms ║║Executed virtual command log (1ms)
+160ms ║╚Execution stage complete. (67ms)
+165ms ╚Event processed successfully (165ms)


#2

Your formatting looks a bit off… try this out and reply back…


#3

I tried this format but I don’t get a choice of your index variable; this is all I can choose from…
Maybe I’m looking in the wrong spot. There are a lot of attributes for currenteventdevice but nothing like Index.

17/10/2017, 14:24:56 +259ms
+2ms ╔Received event [Brewing].button = pushed with a delay of 84ms
+87ms ║RunTime Analysis CS > 21ms > PS > 38ms > PE > 28ms > CE
+95ms ║Runtime (39068 bytes) successfully initialized in 38ms (v0.2.0fa.20171011) (92ms)
+96ms ║╔Execution stage started
+103ms ║║Cancelling statement #23’s schedules…
+112ms ║║pushed
+113ms ║║Executed virtual command log (2ms)
+121ms ║║pushed
+122ms ║║Executed virtual command log (1ms)
+129ms ║║INACTIVE
+130ms ║║Executed virtual command log (1ms)
+141ms ║║4
+141ms ║║Executed virtual command log (1ms)
+154ms ║║Comparison (enum) pushed gets (string) pushed = true (5ms)
+156ms ║║Cancelling condition #31’s schedules…
+156ms ║║Condition #31 evaluated true (12ms)
+157ms ║║Cancelling condition #28’s schedules…
+158ms ║║Condition group #28 evaluated true (state changed) (14ms)
+164ms ║║Evaluating switch with values [[i::4183e9a9d415ad25cd94b65d4f866063::button, v:[t:enum, v:pushed, d::4183e9a9d415ad25cd94b65d4f866063:, a:button, i:[], x:false, vt:string]]]
+167ms ║║Comparison (enum) pushed is (integer) 0 = false (2ms)
+171ms ║║Comparison (enum) pushed is (integer) 1 = false (2ms)
+173ms ║╚Execution stage complete. (77ms)
+182ms ╚Event processed successfully (182ms)


#4

@daven Click the “Switch Statement” and change it from using a physical device to using a variable. Then look through the list of variables and find “$currentEventDeviceIndex”

Try making yours look more like mine :wink:


#5

Insane trying to guess on that! Works now, thanks!
Seems I am going to be using the forum a lot until the example pistons get heavily populated. This is way more in depth than C0RE.
I’ll put my piston up there as soon as it’s all filled in for the next newb :wink: