0
  • 聊天消息
  • 系統(tǒng)消息
  • 評論與回復
登錄后你可以
  • 下載海量資料
  • 學習在線課程
  • 觀看技術視頻
  • 寫文章/發(fā)帖/加入社區(qū)
會員中心
創(chuàng)作中心

完善資料讓更多小伙伴認識你,還能領取20積分哦,立即完善>

3天內不再提示

【開源獲獎案例】多功能稱重器

迪文智能屏 ? 2024-04-20 08:12 ? 次閱讀

——來自迪文開發(fā)者論壇

本期為大家推送迪文開發(fā)者論壇獲獎開源案例——多功能稱重器工程師采用4英寸COF智能屏,通過T5L OS核與HX711模塊及5kg壓力傳感器套裝進行數(shù)據(jù)交互,用戶可輕松實現(xiàn)重量、單價、總價、去皮等計價顯示功能,以及計數(shù)、重量變化曲線跟蹤和稱重器精準度矯正等功能,輕松切換不同應用場景,享受便捷高效稱重體驗。


UI開發(fā)示例

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

C51工程設計 稱重器實現(xiàn)計價功能的部分參考代碼如下:

//計價頁面===================#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();}

聲明:本文內容及配圖由入駐作者撰寫或者入駐合作網站授權轉載。文章觀點僅代表作者本人,不代表電子發(fā)燒友網立場。文章及其配圖僅供工程師學習之用,如有內容侵權或者其他違規(guī)問題,請聯(lián)系本站處理。 舉報投訴
  • 傳感器
    +關注

    關注

    2541

    文章

    49945

    瀏覽量

    747443
  • 開源
    +關注

    關注

    3

    文章

    3125

    瀏覽量

    42067
  • 智能屏幕
    +關注

    關注

    0

    文章

    63

    瀏覽量

    3260
收藏 人收藏

    評論

    相關推薦

    TI 降壓轉換多功能引腳及其應用的簡介

    電子發(fā)燒友網站提供《TI 降壓轉換多功能引腳及其應用的簡介.pdf》資料免費下載
    發(fā)表于 09-10 10:26 ?0次下載
    TI 降壓轉換<b class='flag-5'>器</b><b class='flag-5'>多功能</b>引腳及其應用的簡介

    開源獲獎案例】基于T5L智能屏的指紋識別解決方案

    ——來自迪文開發(fā)者論壇本期為大家推送迪文開發(fā)者論壇獲獎開源案例——基于T5L智能屏的指紋識別解決方案。該方案通過智能屏串口進行Modbus通訊,實現(xiàn)對指紋識別模塊的精準控制,并集成了指紋錄入與識別功能。可用于門禁管理、員工考勤、
    的頭像 發(fā)表于 07-06 08:13 ?147次閱讀
    【<b class='flag-5'>開源</b><b class='flag-5'>獲獎</b>案例】基于T5L智能屏的指紋識別解決方案

    基于T5L芯片的多功能物聯(lián)網開發(fā)套件

    ——來自迪文開發(fā)者論壇本期為大家推送迪文開發(fā)者論壇獲獎開源案例——基于T5L芯片的多功能物聯(lián)網開發(fā)套件。工程師充分運用了T5L1芯片的豐富外設功能,集成了USB、音頻喇叭、PWM信號接
    的頭像 發(fā)表于 06-14 08:13 ?452次閱讀
    基于T5L芯片的<b class='flag-5'>多功能</b>物聯(lián)網開發(fā)套件

    什么是多功能傳感 多功能傳感功能介紹

    多功能傳感是一個集成系統(tǒng),它將射頻 (RF) 頻譜中的多種功能(包括通信、雷達、電子戰(zhàn)以及情報、監(jiān)視和偵察 (ISR))整合到一個傳感中。
    發(fā)表于 04-01 12:41 ?434次閱讀
    什么是<b class='flag-5'>多功能</b>傳感<b class='flag-5'>器</b> <b class='flag-5'>多功能</b>傳感<b class='flag-5'>器</b>的<b class='flag-5'>功能</b>介紹

    開源獲獎案例】隔空手勢識別測試系統(tǒng)

    ——來自迪文開發(fā)者論壇本期為大家推送迪文開發(fā)者論壇獲獎開源案例——隔空手勢識別測試系統(tǒng)。工程師采用7英寸COF智能屏,通過T5LOS核與PAJ7620U2手勢識別傳感進行數(shù)據(jù)交互,不需要使用任何
    的頭像 發(fā)表于 03-16 08:12 ?399次閱讀
    【<b class='flag-5'>開源</b><b class='flag-5'>獲獎</b>案例】隔空手勢識別測試系統(tǒng)

    安科瑞多功能電力儀表設置儀表脈沖常數(shù)教程

    多功能電力儀表
    jf_55193456
    發(fā)布于 :2024年02月02日 15:14:30

    開源獲獎案例】智能培養(yǎng)室

    為大家推送迪文開發(fā)者論壇獲獎開源案例——智能培養(yǎng)室。工程師通過Modbus協(xié)議實現(xiàn)了T5L智能屏控制加熱、風機控溫功能,還可調節(jié)電源功率實現(xiàn)模擬光照功能。系統(tǒng)可根據(jù)屏幕上設定的參數(shù)自動
    的頭像 發(fā)表于 01-09 08:13 ?307次閱讀
    【<b class='flag-5'>開源</b><b class='flag-5'>獲獎</b>案例】智能培養(yǎng)室

    開源獲獎案例】四軸機械臂控制系統(tǒng)

    ——來自迪文開發(fā)者論壇本期為大家推送迪文開發(fā)者論壇獲獎開源案例——四軸機械臂控制系統(tǒng)。工程師采用T5L智能屏,基于DGUS軟件“旋轉指示”控件實現(xiàn)機械臂的實時位置顯示,并通過串口控制機械臂的運動
    的頭像 發(fā)表于 12-23 08:13 ?893次閱讀
    【<b class='flag-5'>開源</b><b class='flag-5'>獲獎</b>案例】四軸機械臂控制系統(tǒng)

    小而美!【aDataFlow】多功能串口工具

    ……【aDataFlow】多功能串口數(shù)據(jù)查看-開源分享-aDataFlow是一款好看又好用的多功能串口數(shù)據(jù)查看/記錄,它的核心為ESP3
    的頭像 發(fā)表于 12-16 08:04 ?1106次閱讀
    小而美!【aDataFlow】<b class='flag-5'>多功能</b>串口工具

    開源 | 小而美!【aDataFlow】多功能串口工具,數(shù)據(jù)監(jiān)聽+USB轉串口+ESP32燒錄

    …… 【aDataFlow】多功能串口數(shù)據(jù)查看 -? 開源分享 - aDataFlow是一款好看又好用的多功能串口數(shù)據(jù)查看/記錄,它的核
    的頭像 發(fā)表于 12-15 16:35 ?3399次閱讀
    <b class='flag-5'>開源</b> | 小而美!【aDataFlow】<b class='flag-5'>多功能</b>串口工具,數(shù)據(jù)監(jiān)聽+USB轉串口+ESP32燒錄<b class='flag-5'>器</b>…

    開源獲獎案例】水泥多量測定儀

    ——來自迪文開發(fā)者論壇本期為大家推送的論壇獲獎開源案例可用于建筑行業(yè)檢測水泥成分含量——基于T5L智能屏的水泥多量測定儀。工程師基于T5L智能屏來控制電子重量檢測模塊、測溫模塊、加熱模塊、水分傳感
    的頭像 發(fā)表于 11-18 08:13 ?374次閱讀
    【<b class='flag-5'>開源</b><b class='flag-5'>獲獎</b>案例】水泥多量測定儀

    內嵌圖形化編程環(huán)境,LiClock多功能墨水屏

    想要擴展性強,易用易開發(fā),功能全且成本低的墨水屏天氣時鐘……尋尋覓覓難合意,那就自己做一個!LiClock多功能墨水屏天氣時鐘-開源分享-今天特別分享@小李電子實驗室大佬的開源佳作——
    的頭像 發(fā)表于 11-18 08:04 ?649次閱讀
    內嵌圖形化編程環(huán)境,LiClock<b class='flag-5'>多功能</b>墨水屏

    開源 | 內嵌圖形化編程環(huán)境,LiClock多功能墨水屏【天氣+時鐘+電子書…】

    想要擴展性強,易用易開發(fā),功能全且成本低的墨水屏天氣時鐘……尋尋覓覓難合意,那就自己做一個! LiClock多功能墨水屏天氣時鐘 - 開源 分享 - 今天特別分享 @小李電子實驗室 大佬的開源
    的頭像 發(fā)表于 11-17 12:15 ?2104次閱讀
    <b class='flag-5'>開源</b> | 內嵌圖形化編程環(huán)境,LiClock<b class='flag-5'>多功能</b>墨水屏【天氣+時鐘+電子書…】

    開源獲獎案例】基于T5L的smtp郵件發(fā)送

    ——來自迪文開發(fā)者論壇本期為您推送一個非常實用的迪文開發(fā)者論壇獲獎開源案例——基于T5L的smtp郵件發(fā)送。工程師采用T5L智能屏,通過WiFi模塊訪問smtp服務,實現(xiàn)了發(fā)送郵件
    的頭像 發(fā)表于 10-31 08:14 ?601次閱讀
    【<b class='flag-5'>開源</b><b class='flag-5'>獲獎</b>案例】基于T5L的smtp郵件發(fā)送<b class='flag-5'>器</b>

    將壓力傳感稱重功能改為記人數(shù)的功能的單片機程序用什么思路?

    將壓力傳感稱重功能改為記人數(shù)的功能的單片機程序用什么思路
    發(fā)表于 10-17 06:47