0
  • 聊天消息
  • 系统消息
  • 评论与回复
登录后你可以
  • 下载海量资料
  • 学习在线课程
  • 观看技术视频
  • 写文章/发帖/加入社区
会员中心
创作中心

完善资料让更多小伙伴认识你,还能领取20积分哦,立即完善>

3天内不再提示

【开源获奖案例】多功能称重器

迪文智能屏 ? 2024-04-20 08:12 ? 次阅读
加入交流群
微信小助手二维码

扫码添加小助手

加入工程师交流群

——来自迪文开发者论坛

本期为大家推送迪文开发者论坛获奖开源案例——多功能称重器工程师采用4英寸COF智能屏,通过T5L OS核与HX711模块及5kg压力传感器套装进行数据交互,用户可轻松实现重量、单价、总价、去皮等计价显示功能,以及计数、重量变化曲线跟踪和称重器精准度矫正等功能,轻松切换不同应用场景,享受便捷高效称重体验。


UI开发示例

be60b46a-feaa-11ee-9118-92fbcf53809c.png

C51工程设计 称重器实现计价功能的部分参考代码如下:

//计价页面===================#define VALUATION_UNIT_PRICE_ADDR 0x1010#define VALUATION_GRAM_ADDR 0x1000#define VALUATION_TOTAL_PRICES_ADDR 0x1020uint32_t valuation_decorticate = 0; //计价去皮重量uint32_t valuation_unit_price = 0; //单价//单价刷新void page_valuation_unit_price_refresh(){ uint8_t test_display[10] = {0}; if(valuation_unit_price < 1000) { test_display[0] = valuation_unit_price / 100 % 10 + 0x30; test_display[1] = '.'; test_display[2] = valuation_unit_price / 10 % 10 + 0x30; test_display[3] = valuation_unit_price / 1 % 10 + 0x30; dgus_show_text_value_set(VALUATION_UNIT_PRICE_ADDR, test_display, 4); } else if(valuation_unit_price < 10000) { test_display[0] = valuation_unit_price / 1000 % 10 + 0x30; test_display[1] = valuation_unit_price / 100 % 10 + 0x30; test_display[2] = '.'; test_display[3] = valuation_unit_price / 10 % 10 + 0x30; test_display[4] = valuation_unit_price / 1 % 10 + 0x30; dgus_show_text_value_set(VALUATION_UNIT_PRICE_ADDR, test_display, 4); } else if(valuation_unit_price < 100000) { test_display[0] = valuation_unit_price / 10000 % 10 + 0x30; test_display[1] = valuation_unit_price / 1000 % 10 + 0x30; test_display[2] = valuation_unit_price / 100 % 10 + 0x30; test_display[3] = '.'; test_display[4] = valuation_unit_price / 10 % 10 + 0x30; test_display[5] = valuation_unit_price / 1 % 10 + 0x30; dgus_show_text_value_set(VALUATION_UNIT_PRICE_ADDR, test_display, 4); } else if(valuation_unit_price < 1000000) { test_display[0] = valuation_unit_price / 100000 % 10 + 0x30; test_display[1] = valuation_unit_price / 10000 % 10 + 0x30; test_display[2] = valuation_unit_price / 1000 % 10 + 0x30; test_display[3] = valuation_unit_price / 100 % 10 + 0x30; test_display[4] = '.'; test_display[5] = valuation_unit_price / 10 % 10 + 0x30; test_display[6] = valuation_unit_price / 1 % 10 + 0x30; dgus_show_text_value_set(VALUATION_UNIT_PRICE_ADDR, test_display, 4); }}
//重量刷新void page_valuation_weight_refresh(){ uint8_t test_display[10] = {0x30}; uint32_t gram_display = 0; if(gram_value >= valuation_decorticate) { gram_display = gram_value - valuation_decorticate; if(gram_display < 10) { test_display[0] = gram_display / 1 % 10 + 0x30; dgus_show_text_value_set(VALUATION_GRAM_ADDR, test_display, 3); } else if(gram_display < 100) { test_display[0] = gram_display / 10 % 10 + 0x30; test_display[1] = gram_display / 1 % 10 + 0x30; dgus_show_text_value_set(VALUATION_GRAM_ADDR, test_display, 3); } else if(gram_display < 1000) { test_display[0] = gram_display / 100 % 10 + 0x30; test_display[1] = gram_display / 10 % 10 + 0x30; test_display[2] = gram_display / 1 % 10 + 0x30; dgus_show_text_value_set(VALUATION_GRAM_ADDR, test_display, 3); } else if(gram_display < 10000) { test_display[0] = gram_display / 1000 % 10 + 0x30; test_display[1] = gram_display / 100 % 10 + 0x30; test_display[2] = gram_display / 10 % 10 + 0x30; test_display[3] = gram_display / 1 % 10 + 0x30; dgus_show_text_value_set(VALUATION_GRAM_ADDR, test_display, 3); } else if(gram_display < 100000) { test_display[0] = gram_display / 10000 % 10 + 0x30; test_display[1] = gram_display / 1000 % 10 + 0x30; test_display[2] = gram_display / 100 % 10 + 0x30; test_display[3] = gram_display / 10 % 10 + 0x30; test_display[4] = gram_display / 1 % 10 + 0x30; dgus_show_text_value_set(VALUATION_GRAM_ADDR, test_display, 3); } } else { dgus_show_text_value_set(VALUATION_GRAM_ADDR, test_display, 3); }}
//总价刷新void page_valuation_price_refresh(){ uint32_t price_value = 0; uint8_t test_display[10] = {0x30, '.', 0x30, 0x30}; if(gram_value >= valuation_decorticate) { price_value = (gram_value - valuation_decorticate) * valuation_unit_price * 2 / 1000; if(price_value < 1000) { test_display[0] = price_value / 100 % 10 + 0x30; test_display[1] = '.'; test_display[2] = price_value / 10 % 10 + 0x30; test_display[3] = price_value / 1 % 10 + 0x30; dgus_show_text_value_set(VALUATION_TOTAL_PRICES_ADDR, test_display, 4); } else if(price_value < 10000) { test_display[0] = price_value / 1000 % 10 + 0x30; test_display[1] = price_value / 100 % 10 + 0x30; test_display[2] = '.';

test_display[3] = price_value / 10 % 10 + 0x30; test_display[4] = price_value / 1 % 10 + 0x30; dgus_show_text_value_set(VALUATION_TOTAL_PRICES_ADDR, test_display, 4); } else if(price_value < 100000)

{ test_display[0] = price_value / 10000 % 10 + 0x30; test_display[1] = price_value / 1000 % 10 + 0x30; test_display[2] = price_value / 100 % 10 + 0x30; test_display[3] = '.'; test_display[4] = price_value / 10 % 10 + 0x30; test_display[5] = price_value / 1 % 10 + 0x30; dgus_show_text_value_set(VALUATION_TOTAL_PRICES_ADDR, test_display, 4);

} else if(price_value < 1000000) { test_display[0] = price_value / 100000 % 10 + 0x30; test_display[1] = price_value / 10000 % 10 + 0x30; test_display[2] = price_value / 1000 % 10 + 0x30; test_display[3] = price_value / 100 % 10 + 0x30; test_display[4] = '.'; test_display[5] = price_value / 10 % 10 + 0x30; test_display[6] = price_value / 1 % 10 + 0x30; dgus_show_text_value_set(VALUATION_TOTAL_PRICES_ADDR, test_display, 4); } } else { dgus_show_text_value_set(VALUATION_TOTAL_PRICES_ADDR, test_display, 4); }}void page_valuation_decorticate(){ valuation_decorticate = gram_value; page_valuation_weight_refresh();}void page_valuation_1(){ if(valuation_unit_price < 100000) { valuation_unit_price = valuation_unit_price * 10 + 1; page_valuation_unit_price_refresh(); }}void page_valuation_2(){ if(valuation_unit_price < 100000) { valuation_unit_price = valuation_unit_price * 10 + 2; page_valuation_unit_price_refresh(); }}void page_valuation_3(){ if(valuation_unit_price < 100000) { valuation_unit_price = valuation_unit_price * 10 + 3; page_valuation_unit_price_refresh(); }}void page_valuation_4(){ if(valuation_unit_price < 100000) { valuation_unit_price = valuation_unit_price * 10 + 4; page_valuation_unit_price_refresh(); }}

void page_valuation_5(){ if(valuation_unit_price < 100000) { valuation_unit_price = valuation_unit_price * 10 + 5; page_valuation_unit_price_refresh(); }}void page_valuation_6(){ if(valuation_unit_price < 100000) { valuation_unit_price = valuation_unit_price * 10 + 6; page_valuation_unit_price_refresh(); }}void page_valuation_7(){ if(valuation_unit_price < 100000) { valuation_unit_price = valuation_unit_price * 10 + 7; page_valuation_unit_price_refresh(); }}void page_valuation_8(){ if(valuation_unit_price < 100000) { valuation_unit_price = valuation_unit_price * 10 + 8; page_valuation_unit_price_refresh(); }}void page_valuation_9(){ if(valuation_unit_price < 100000) { valuation_unit_price = valuation_unit_price * 10 + 9; page_valuation_unit_price_refresh(); }}void page_valuation_0(){ if(valuation_unit_price < 100000) { valuation_unit_price = valuation_unit_price * 10 + 0; page_valuation_unit_price_refresh(); }}void page_valuation_back(){ valuation_unit_price = valuation_unit_price / 10; page_valuation_unit_price_refresh();}void page_valuation_clear(){ valuation_unit_price = 0; page_valuation_unit_price_refresh();}

声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉
  • 传感器
    +关注

    关注

    2568

    文章

    53325

    浏览量

    770509
  • 开源
    +关注

    关注

    3

    文章

    3784

    浏览量

    44149
  • 智能屏幕
    +关注

    关注

    0

    文章

    73

    浏览量

    3686
收藏 人收藏
加入交流群
微信小助手二维码

扫码添加小助手

加入工程师交流群

    评论

    相关推荐
    热点推荐

    千方科技推出多功能交通调查站解决方案

    2025年初,交通运输部印发《普通国省道多功能交通调查站布局和建设方案》,要求各省市加快建设多功能交通调查站,提升国省道交通调查能力,推进公路数字化。千方科技快速响应并推出“智能感知+边端融合”的多功能交通调查站解决方案,支持“
    的头像 发表于 07-09 15:52 ?483次阅读

    称重控制仪表通过工业网关数据采集到MES系统中

    称重控制仪表是一种高精度、自动化、多功能称重控制仪表,广泛应用于多个行业,如锂电、化工、冶金、食品、医药等。作为自动称重配料控制系统的重要组件,
    的头像 发表于 06-19 13:57 ?296次阅读

    开源获奖案例】基于T5L智能屏的音乐播放与歌词显示方案

    ——来自迪文开发者论坛本期为大家推送迪文开发者论坛获奖开源案例——基于T5L智能屏的音乐播放与歌词显示方案。该方案通过T5L串口与通用开发板、解码板进行数据交互,将解析完成的音频和歌词通过串口发送给智能屏,实现音乐播放、歌词显示、歌曲播放进度控制等
    的头像 发表于 05-08 09:52 ?336次阅读
    【<b class='flag-5'>开源</b><b class='flag-5'>获奖</b>案例】基于T5L智能屏的音乐播放与歌词显示方案

    开源获奖案例】基于T5L智能屏的零食机

    ——来自迪文开发者论坛本期为大家推送迪文开发者论坛获奖开源案例——基于T5L智能屏的零食机。该方案基于T5L芯片,通过PWM接口实现实时调控爪子抓取力度、速度,并支持后台按键长按时间读取,各模块自检
    的头像 发表于 04-30 18:20 ?272次阅读
    【<b class='flag-5'>开源</b><b class='flag-5'>获奖</b>案例】基于T5L智能屏的零食机

    基于stm32设计一个多功能体重秤

    使用四个50kg的半桥式电阻应变片和hx711组成称重传感器,想各位大神怎么编写代码能获取真实的体重?
    发表于 04-12 22:07

    开源获奖案例】基于T5L智能屏的FM收音机

    ——来自迪文开发者论坛本期为大家推送迪文开发者论坛获奖开源案例——基于T5L智能屏的FM收音机。该方案基于T5L智能屏,通过串口4与FM收音机模块进行通讯,实现自动搜索获取不同频段电台,同时支持选台、频率调节、音量控制等功能,为
    的头像 发表于 03-28 15:39 ?485次阅读
    【<b class='flag-5'>开源</b><b class='flag-5'>获奖</b>案例】基于T5L智能屏的FM收音机

    S型称重传感器的原理与选择使用

    S型称重传感器是传感领域中一种常见且重要的设备,广泛应用于工业生产和包装行业等领域。本文将详细介绍S型称重传感器的工作原理、选择要点以及使用说明,以期为相关行业从业者提供有价值的参考。 一、S型
    的头像 发表于 03-04 18:27 ?555次阅读
    S型<b class='flag-5'>称重传感器</b>的原理与选择使用

    开源获奖案例】基于T5L智能屏的EQ均衡效果

    ——来自迪文开发者论坛本期为大家推送迪文开发者论坛获奖开源案例——基于T5L智能屏的EQ均衡效果。工程师采用800×480分辨率屏幕,通过T5L串口4与均衡效果开发板通讯,调节中心
    的头像 发表于 02-14 11:27 ?599次阅读
    【<b class='flag-5'>开源</b><b class='flag-5'>获奖</b>案例】基于T5L智能屏的EQ均衡效果<b class='flag-5'>器</b>

    多功能智慧路灯系统整体解决方案介绍

    多功能智慧路灯系统整体解决方案介绍
    的头像 发表于 01-15 09:12 ?717次阅读
    <b class='flag-5'>多功能</b>智慧路灯系统整体解决方案介绍

    安科瑞ADF400L多功能电表产品简单介绍

    多功能电表
    jf_25373932
    发布于 :2024年12月03日 15:59:48

    多功能UC1834优化线性调节效率

    电子发烧友网站提供《多功能UC1834优化线性调节效率.pdf》资料免费下载
    发表于 10-24 09:51 ?0次下载
    <b class='flag-5'>多功能</b>UC1834优化线性调节<b class='flag-5'>器</b>效率

    物联网行业中的智能称重方案介绍_称重传感器分析

    物联网系统中为什么要使用称重传感器 ??联网系统中使用称重传感器的原因主要有以下几点: 全面感知与信息采集 基础感知元件:传感是物联网的感觉器官,能够感知、探测、采集和获取目标对象各种形态的信息
    的头像 发表于 09-24 14:30 ?1126次阅读
    物联网行业中的智能<b class='flag-5'>称重</b>方案介绍_<b class='flag-5'>称重传感器</b>分析

    开源获奖案例】基于T5L智能屏的汽车抬头显示方案

    ——来自迪文开发者论坛本期为大家推送迪文开发者论坛获奖开源案例——基于T5L智能屏的汽车抬头显示方案。该方案采用COF智能屏,通过T5LCAN接口,实时获取汽车OBDII诊断接口的数据,并将接收到的车速和转速数据同步显示在屏幕
    的头像 发表于 09-24 08:03 ?801次阅读
    【<b class='flag-5'>开源</b><b class='flag-5'>获奖</b>案例】基于T5L智能屏的汽车抬头显示<b class='flag-5'>器</b>方案

    TI 降压转换多功能引脚及其应用的简介

    电子发烧友网站提供《TI 降压转换多功能引脚及其应用的简介.pdf》资料免费下载
    发表于 09-10 10:26 ?0次下载
    TI 降压转换<b class='flag-5'>器</b><b class='flag-5'>多功能</b>引脚及其应用的简介

    多功能引脚及其在TI降压转换中的应用

    电子发烧友网站提供《多功能引脚及其在TI降压转换中的应用.pdf》资料免费下载
    发表于 08-26 14:35 ?0次下载
    <b class='flag-5'>多功能</b>引脚及其在TI降压转换<b class='flag-5'>器</b>中的应用