Touch sensors
Your LEGO® MINDSTORMS® Education EV3 has touch sensors that work like buttons. Instead of saying enter
or left
as the source button, use a touch sensor block with a sensor name like touch 1
.
if (sensors.touch1.isPressed()) {
console.log("Hey, I feel pressed.");
}
Read about touch sensors and using them as touch buttons.