本文主要是介绍2023年电子产品设计及制作赛题(模拟工业传送带物品识别系统),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
2023年电子产品设计及制作赛题(模拟工业传送带物品识别系统)
赛题部分:
- 赛题最后会上传到资源里。
- 本人参加的是今年的智能电子产品设计制作,成绩不是很理想,国三,有一定经验,可以分享。
功能介绍:
- 静态识别模式:电视机上以静止图片方式,连续播放 3 幅图片,每幅图片
停留 10 秒; - 低速识别模式:电视机上以低速(3~10cm/s)播放连续视频,播放 15s;
- 电视机上以高速(10~30cm/s)播放连续视频,播放 15s;
系统检测到待测物品时,先以语音播报提示,然后用激光笔照射
检测到的物品。 - 物品检测系统在工作中,每当发现符合特征条件的物品时,通过
RS-485 通讯接口,向运行维护系统发送一条报文。 - 在检测工作结束时,将在不同检测难度条件下检测,到的物品统计数据发送一组报文给运行维护系统。运维管理由昆仑通态等触摸屏实现,触摸屏已配备软件,可显示接收到的报文。述检测结果,也需要在系统内的 LCD 显示器上显示,显示信息满屏后自动向上滚动;
几个页面部分:
部分代码:
- 主要是接收串口的数据进行处理,
void HAL_Camera_Process(void){if (CAMEAR_RX_BUF[0] == 0xAA && CAMEAR_RX_BUF[1] == 0x03){if (CAMEAR_RX_BUF[9] == 0x00){if (hal_data.data_running_mode > mode_static){DisplayTV_Play(play_pause);}if (hal_data.data_running_mode == mode_custom){camera_count->time_start_flag =false;}}if (hal_data.data_running_mode == mode_static || CAMEAR_RX_BUF[9] == 1){switch (CAMEAR_RX_BUF[2]) {case mode_static:hal_data.data_mode[hal_data.receiver_num] = mode_static;hal_data.voice_data.data_voice_mode[hal_data.receiver_num] = va_static;break;case mode_slow:hal_data.data_mode[hal_data.receiver_num] = mode_slow;hal_data.voice_data.data_voice_mode[hal_data.receiver_num] = va_slow;break;case mode_fast:hal_data.data_mode[hal_data.receiver_num] = mode_fast;hal_data.voice_data.data_voice_mode[hal_data.receiver_num] = va_fast;break;case mode_custom:hal_data.data_mode[hal_data.receiver_num] = mode_custom;hal_data.voice_data.data_voice_mode[hal_data.receiver_num] = va_custom;break;default:hal_data.data_mode[hal_data.receiver_num] = mode_none;hal_data.voice_data.data_voice_mode[hal_data.receiver_num] = va_none;break;}/* 获取颜色 */hal_data.data_color[hal_data.receiver_num] = CAMEAR_RX_BUF[3];/* 获取形状 */hal_data.data_shape[hal_data.receiver_num] = CAMEAR_RX_BUF[4];/* 获取背景颜色 */hal_data.data_background[hal_data.receiver_num] = CAMEAR_RX_BUF[10];/* 传回的坐标数据 */hal_data.data_x_coordinate[hal_data.receiver_num] = ((CAMEAR_RX_BUF[5] << 8) + CAMEAR_RX_BUF[6]);hal_data.data_y_coordinate[hal_data.receiver_num] = ((CAMEAR_RX_BUF[7] << 8) + CAMEAR_RX_BUF[8]);/* 舵机的坐标数据 */if (hal_data.data_running_mode == mode_static){hal_data.servo_data.servo_x = (hal_data.data_x_coordinate[hal_data.receiver_num] - 352) / 10.0;//hal_data.servo_data.servo_y = (hal_data.data_y_coordinate[hal_data.receiver_num] -180) / 10.0; // }if (hal_data.data_running_mode == mode_slow){hal_data.servo_data.servo_x = (hal_data.data_x_coordinate[hal_data.receiver_num] - 352) / 10.0;//hal_data.servo_data.servo_y = (hal_data.data_y_coordinate[hal_data.receiver_num] -180) / 10.0; // }if (hal_data.data_running_mode == mode_fast){hal_data.servo_data.servo_x = (hal_data.data_x_coordinate[hal_data.receiver_num] - 352) / 10.0;//hal_data.servo_data.servo_y = (hal_data.data_y_coordinate[hal_data.receiver_num] -180) / 10.0; // }/* 时间显示数据 */hal_data.timer_data.data_hour[hal_data.receiver_num] = rhour;hal_data.timer_data.data_min [hal_data.receiver_num] = rmin;hal_data.timer_data.data_sec [hal_data.receiver_num] = rsec;hal_data.timer_data.data_background[hal_data.receiver_num] = 0;/* 昆仑组态显示的数据 */kl_cmd_info[5] = hal_data.data_mode[hal_data.receiver_num];kl_cmd_info[6] = hal_data.timer_data.data_hour[hal_data.receiver_num];kl_cmd_info[7] = hal_data.timer_data.data_min[hal_data.receiver_num];kl_cmd_info[8] = hal_data.timer_data.data_sec[hal_data.receiver_num];kl_cmd_info[9] = hal_data.data_shape[hal_data.receiver_num];kl_cmd_info[10] = hal_data.data_color[hal_data.receiver_num];kl_cmd_info[11] = hal_data.data_x_coordinate[hal_data.receiver_num];kl_cmd_info[12] = hal_data.data_y_coordinate[hal_data.receiver_num];kl_cmd_info[13] = hal_data.mode_count.data_mode1_count;kl_cmd_info[14] = hal_data.mode_count.data_mode2_count;kl_cmd_info[15] = hal_data.mode_count.data_mode3_count;kl_cmd_info[16] = hal_data.data_background[hal_data.receiver_num];/* 绘制图形坐标 */hal_data.draw_data.draw_x_pos[hal_data.receiver_num] = hal_data.data_x_coordinate[hal_data.receiver_num] * 0.68;hal_data.draw_data.draw_y_pos[hal_data.receiver_num] = hal_data.data_y_coordinate[hal_data.receiver_num] * 0.82;}if (CAMEAR_RX_BUF[11] == 0x55){/* 数据全部接收完毕 */hal_data.data_rc_flag = true;}}/* 执行函数 */if (hal_data.data_rc_flag == true){/* 将数据发送到昆仑组态显示屏幕 */Uart_Send(uart_rs485,kl_cmd_info, sizeof(kl_cmd_info));/* 语音播报函数 */VoiceAssistant_Send_Info(hal_data.data_running_mode);/* 控制舵机 */Servo_Coordinate_instructions((float)(hal_data.servo_data.servo_x),(float)(hal_data.servo_data.servo_y));/* 开启激光笔 */hal_data.laser_status = true;/* 接收数据指针++ */hal_data.receiver_num++;/* 事件执行完毕标志位 */hal_data.data_rc_flag = false;}
视频已经上传到资源
总结:
最后说一下,所有分享的资源能上传的都在上面,有问题的可以看评论
这篇关于2023年电子产品设计及制作赛题(模拟工业传送带物品识别系统)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!