Hello
I am making a kirby-like platformer for the NXT using the nxt buttons(so everyone can play), but I can't get NXC to recognize two button presses at the same time. Only one is shown as being pressed. I am using ButtonPressed for each button to detect if a certain one is pressed, but if i push two, the NXT will only detect one.
NXC buttons help
-
- Posts: 16
- Joined: 09 Oct 2010, 16:50
NXC buttons help
"To be able to ask a question clearly is two-thirds of the way to getting it answered."
-John Ruskin-
-John Ruskin-
Re: NXC buttons help
I can't remember where exactly but in a recent post John Hansen stated that the NXC code applies a mutex to the buttoncall function to specifically avoid reading two buttons at once.
Don't know if you can press two touch sensors at once.
Don't know if you can press two touch sensors at once.
A sophistical rhetorician, inebriated with the exuberance of his own verbosity, and gifted with an egotistical imagination that can at all times command an interminable and inconsistent series of arguments to malign an opponent and to glorify himself.
Re: NXC buttons help
You cannot press the left+ right, or left+center or right+center, but you can press center+exit, left+exit, right+exit, touch+touch(touch is touch sensor), left+touch, right+touch, exit+touch, center+touch, center+touch+touch, left+touch+touch,right+touch+touch, etc.
Thanks, and have a nice day,
nxtboy III
programnxt.com
nxtboy III
programnxt.com
Re: NXC buttons help
And support for sensing multiple button presses at the same time (as described by nxtboyiii) requires the enhanced NBC/NXC firmware. The standard firmware does not support sensing multiple button presses at the same time.
The limitations described by nxtboyiii are due to the hardware design of the NXT buttons.
The reference to acquire and release in ButtonPressed has to do with trying to read button state from two different threads at the same time - not the ability to sense multiple buttons actually pressed at the same time.
John Hansen
The limitations described by nxtboyiii are due to the hardware design of the NXT buttons.
The reference to acquire and release in ButtonPressed has to do with trying to read button state from two different threads at the same time - not the ability to sense multiple buttons actually pressed at the same time.
John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
http://bricxcc.sourceforge.net/
Who is online
Users browsing this forum: No registered users and 2 guests