Reply To: wait for input from touch sensor

HomeForumsMonoBrick EV3 Firmwarewait for input from touch sensorReply To: wait for input from touch sensor

Author Image

You use the button event and a loop. But that doesn’t work: You either have to use the button event or the loop.
Here is a quick example on how to use buttons without event:
`Buttons.ButtonStates TastenStatus = new Buttons.ButtonStates ();
Buttons.Instance.LedPattern (1);
do {
TastenStatus = Buttons.Instance.GetKeypress();
if (TastenStatus == Buttons.ButtonStates.Enter) { LcdConsole.WriteLine(“Enter is pressed.”); }
else LcdConsole.WriteLine(Convert.ToString(TastenStatus) + ” is pressed.”);
} while (TastenStatus != Buttons.ButtonStates.Escape);

Posted in

Make a donation