Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有人能告诉我如何使用我可以在脚本中使用的 ROBOTC 程序(“ROBOTC for LEGO Mindstorms 4.X”)从 LEGO Mindstorms EV3 积木上的积木按钮获取输入吗?当我输入“button”时,程序会给我一些建议,比如“buttonLeft”和“BUTTONTYPE”。我认为这应该是可能的,因为我可以找到许多使用 LEGO Mindstorms Education EV3 学生版的教程,但没有一个使用 RobotC。
buttonLeft通常Buttontypes是 getButtonPress 函数的枚举。如果要获取输入,则必须使用 while 循环并检查每次迭代的按钮状态。
buttonLeft
Buttontypes
while(true){ if(getButtonPress(buttonUp)) { //runs code here every iteration the top button is down } }