06计② XX 44
成绩:
教师评语
指导教师签名: 批阅日期:
实验目:1 熟悉机器仿真台VJC安装组成
2 学会特定务机器程序设计仿真
实验容:设计够完成类务机器程序
实验设备:安装VJC机器仿真台PC机
四实验程(实验步骤记录数分析)
1编写机器够着彩线左端走右端(场景 广茂达仿真场线走场ini)
Int surf_10
Int gi_10
Void main()
{
eyecolor(14)
eyecolor(14)
surf_1surface()
while(surf_10)
{ drive(400)
Wait(0100000)
Stop()
Surf_1surface()
}
While(surf_1128)
{
If(surf_1170)
{ drive(400)
Wait(0100000)
Stop()
}
Else
{ while(surf_1170)
{ if(gi_1<2)
{ drive(400)
Wait(00900000)
Stop()
}
else
{ drive(040)
Wait(00900000)
Stop()
}
tone(5232000120250000)
surf_1surface()
}
Surf_1surface()
Printf(surf_1d\nsurf_1)
}
drive(800)
Wait(0500000)
Stop()
Stop()
Subroutine_1()
drive(080)
Wait(06500000)
Stop()
Printf(end\n)
enecolor(13)
enecolor(23)
}
}
2编写机器够点燃蜡烛运动(场景 广茂达仿真场蜡烛场ini)
int ir_10
int photo_10
int photo _20
int photo _30
int bmp_10
int gi_10
int gi_20
int gi_30
void main()
{ gi_10
gi_20
gi_30
While(1)
{
ir_1 ir_detector()
bmp_1bumper()
subroutine_1()
photo_1( photo(1)+ photo(2))2
if(photo_1<60)
{
stop()
wait(05000000)
tone(5232000120250000)
tone(5872990120250000)
tone(6592000120250000)
tone(261600006050000)
tone(293600006050000)
drive(080)
Wait(0100000)
Stop()
tone(5232000120250000)
tone(5872990120250000)
tone(6592000120250000)
tone(261600006050000)
tone(5232000120250000)
tone(5232000120250000)
drive(080)
Wait(01600000)
Stop()
tone(5232000120250000)
tone(5872990120250000)
tone(6592000120250000)
tone(261600006050000)
tone(5232000120250000)
drive(080)
sleep(0100000)
Stop()
sleep(0500000)
motor(10)
motor(20)
motor(3100)
gi_31
Wait(1500000)
}
Else
{
drive(080)
sleep(00500000)
Stop()
Wait(1500000)
}
3编写机器够房间中蜡烛运动(场景 广茂达仿真场房间中趋光运动ini)
int ir_10
int photo_10
int surf_10
int gi_10
int gi_20
int gi_30
float gf_100
void main()
{gi_34
Subroutine_2()
If(gi_21)
Subroutine_1()
}
Else{gi_34
Subroutine_4()
Subroutine_6()
If(gi_21)
{
Subroutine_1()
}
Else
{gi_34
Subroutine_3()
Subroutine_6()
If(gi_21)
{
Subroutine_1()
}
Else{gi_33
Subroutine_5()
Subroutine_6()
If(gi_21)
{ Subroutine_1()
}
Else
{ Subroutine_7()
}
}
}
eyecolor(14)
eyecolor(24)
{int i_65for(int i_65 i_65<3i_65++)
{ printf(\n)
tone(5232000120250000)
wait(05000000)
tone(5232000120250000)
wait(05000000)
}
}
eyecolor(10)
eyecolor(20)
}
4编写机器够根声音强度产生0~2间机数跳相应格子中(场景 广茂达仿真场跳格子ini)
int ir_10
void main()
{
While(1)
{
If(Ir_14)
{ eyecolor(14)
eyecolor(24)
tone(5232000120250000)
tone(5872990120250000)
tone(6592000120250000)
drive(080)
Wait(0200000)
Stop()
drive(080)
Wait(0300000)
Stop()
eyecolor(10)
eyecolor(20)
}
Else
{
Ir_1ir_detector()
If(ir_1)1
{
eyecolor(14)
eyecolor(24)
tone(5232000120250000)
tone(5872990120250000)
tone(6592000120250000)
drive(800)
Wait(0200000)
Stop()
drive(080)
Wait(0300000)
Stop()
eyecolor(10)
eyecolor(20)
}
Else
{
drive(800)
Wait(0100000)
Stop()
}
}
}
}
5编写机器够房间外围找房门(场景 广茂达仿真场房间浏览ini)
int bmp_10
void main()
{
While(1)
{
Bmp_1bumper()
If(bmp_13)
{
Tone(5232000120250000)
drive(800)
Wait(0200000)
Stop()
drive(080)
Wait(0300000)
Stop()
Printf(bmp_1d\nbmp_1)
}
Else
{
Bmp_1bumper()
If(bmp_110)
{
Tone(587299880250000)
drive(800)
Wait(0200000)
Stop()
drive(0 80)
Wait(0330000)
Stop()
Printf(bmp_1d\nbmp_1)
}
Else
{
Bmp_1bumper()
If(bmp_15)
{
Tone(6592000120250000)
drive(800)
Wait(0200000)
Stop()
drive(0 80)
Wait(0280000)
Stop()
Printf(bmp_1d\nbmp_1)
}
Else
{ drive(800)
Wait(0100000)
Stop()
}
}
}
6编写机器够避开障碍端走端(场景 广茂达仿真场越障跑ini)
int bmp_10
int gi_10
void main()
{
gi_10
while(1)
{
drive(800)
Wait(0100000)
Stop()
bmp_1bumper()
if(bmp_14)
{ tone(2616000060250000)
drive(800)
Wait(0100000)
Stop()
If(gi_1<2)
{ drive(800)
Wait(0200000)
Stop()
gi_1 gi_1+1
}
else
{
drive(080)
Wait(0270000)
Stop()
gi_1 0
}
}
Else
{
If(bmp_12)
{
tone(587299880250000)
drive(800)
Wait(0200000)
Stop()
drive(080)
Wait(0300000)
Stop()
}
Else
{
If(bmp_10)
{
drive(800)
Wait(0300000)
Stop()
drive(080)
Wait(0300000)
Stop()
}
}
}
}
五测试调试实验结果分析
实验结果预期结果样
六实验结体会
次实验操作程中没遇问题较利完成达实验目
2009年 6月 16日
《香当网》用户分享的内容,不代表《香当网》观点或立场,请自行判断内容的真实性和可靠性!
该内容是文档的文本内容,更好的格式请下载文档