01 点击Motor and Sensor Setup快捷按钮,对端口进行设置 去除所有的马达设置: 修改传感器设置: 02 添加if…else…分支结构,以80mm为阈值(比较值),对测量到的距离进行分段处理 03 添加TouchLED的颜色 04 去除80mm处的抖动 在80mm处会存在抖动现象,TouchLED呈现忽闪忽闪的不稳定现象。 解决方案:提高熄灭LED的阈值,即...
#pragma config(Sensor, port6, led, sensorVexIQ_LED) #pragma config(Sensor, port7, bumper, sensorVexIQ_Touch) //*!!Code automatically generated by 'ROBOTC' configuration wizard!!*// task main(){ int i=0; while(1){ if(getBumperValue(bumper)==1){ i++; i%=13; while(getBumperValu...
还要有能力把各种各样电子元器件焊接,原始材料切割加工、传感器、舵机组装调试组装到一起等等。
(VEX 2.0)12 Digital Ports–Touchsensor,ultrasonic range finder,shaft encoder8Analog Inputs–Light sensor, line tracking sensor, potentiometer10Motor Ports–Ports #1 and 10: 2-wire DC ports–Portsa#2 through: 3-wirewulsewidth modulated (PWM)VEXnetConnection–Fits USB cable or wireless key for ...
(VEX 2.0)12 Digital Ports–Touchsensor,ultrasonic range finder,shaft encoder8Analog Inputs–Light sensor, line tracking sensor, potentiometer10Motor Ports–Ports #1 and 10: 2-wire DC ports–Portsa#2 through: 3-wirewulsewidth modulated (PWM)VEXnetConnection–Fits USB cable or wireless key for ...
A touch sensor that detects contact and reports back to the cortex whether it is being pushed in or not. Cortex The 'brain' or controller of the robot. task main () The main part of the program that the robot runs when you press START. It begins and ends with curly braces { }. ...
#pragma config(Sensor, port1, touch, sensorVexIQ_LED)//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//taskmain(){intt1,t0;boolflag=true;while(1){displayCenteredTextLine(1,"PgmRunTime=%d",nPgmTime/1000);if(flag==true&&getTouchLEDValue(touch)==1){t0=nPgmTime/10...
(1)t=25秒~35秒:发出一次声音、持续闪烁红灯,提示“换操控手” (2)t=40秒~49秒:亮黄灯,提示时间 (3)t=50秒~59秒:闪烁蓝灯,提示最后十秒 (4)t=60秒:用声音提示时间到,比赛结束。 RobotC程序如下: #pragma config(Sensor, port1,led,sensorVexIQ_LED) //*!!Code automatically generated by 'ROBOT...