[Open source] ဘက်စုံသုံး အလေးချိန် ကိရိယာ

—— DWIN Developer Forum မှ

ဤစာစောင်တွင်၊ ကျွန်ုပ်တို့သည် DWIN Developer Forum - Multi-function Weigher ၏ ဆုရ open-source case ကို တွန်းအားပေးပါသည်။ အင်ဂျင်နီယာသည် 4-လက်မ COF စမတ်စခရင်ကို လက်ခံရရှိပြီး T5L OS core နှင့် HX711 module နှင့် 5kg ဖိအားအာရုံခံကိရိယာအစုံတို့ကြားတွင် ဒေတာအပြန်အလှန်တုံ့ပြန်မှုမှတစ်ဆင့် သုံးစွဲသူများသည် အလေးချိန်၊ ယူနစ်စျေးနှုန်း၊ စုစုပေါင်းစျေးနှုန်း၊ ကောက်ညှင်းပင်စသည်ဖြင့် ရေတွက်သည့်မျက်နှာပြင်လုပ်ဆောင်ချက်များကို အလွယ်တကူ သိရှိနားလည်နိုင်မည်ဖြစ်သည်။ .၊ ရေတွက်ခြင်း၊ အလေးချိန်ပြောင်းလဲခြင်းမျဉ်းကွေးများကို ခြေရာခံခြင်း၊ အလေးချိန် တိကျမှန်ကန်မှုကို ပြုပြင်ခြင်းစသဖြင့်၊ အဆင်ပြေပြေနှင့် ထိရောက်သောအလေးချိန်ကိုခံစားနိုင်ရန် မတူညီသောအပလီကေးရှင်းအခြေအနေများကြားတွင် လွယ်ကူစွာပြောင်းနိုင်စေရန်။

1. UI ဖွံ့ဖြိုးတိုးတက်မှု

f26af533d43728cd210e0f7af5e7acc

2.C51 ဒီဇိုင်း

စျေးနှုန်းလုပ်ဆောင်ချက်ကို အကောင်အထည်ဖော်ရန်အတွက် အလေးချိန်ကိရိယာအတွက် ရည်ညွှန်းကုဒ်၏ အစိတ်အပိုင်းမှာ အောက်ပါအတိုင်းဖြစ်သည်-

// ဈေးနှုန်း Page ==========

# VALUATION_UNIT_PRICE_ADDR 0x1010 ကိုသတ်မှတ်ပါ။

# VALUATION_GRAM_ADDR 0x1000 ကိုသတ်မှတ်ပါ။

VALUATION_TOTAL_PRICES_ADDR 0x1020 ကို #သတ်မှတ်ပါ။

uint32_t valuation_decorticate = 0; // စျေးနှုန်း Tare Weight

uint32_t valuation_unit_price = 0; //တစ်ခုချင်းစျေးနှုန်း

// ယူနစ်စျေးနှုန်း ပြန်လည်စတင်ပါ။

ပျက်ပြယ်သော page_valuation_unit_price_refresh()

{

uint8_t test_display[10] = {0};

if(valuation_unit_price

{

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);

}

အခြားဆိုလျှင် (valuation_unit_price

{

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);

}

အခြားဆိုလျှင် (valuation_unit_price

{

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);

}

အခြားဆိုလျှင် (valuation_unit_price

{

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);

}

}

 

// Weight Refresh

ပျက်ပြယ်သော 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

{

test_display[0] = gram_display / 1 % 10 + 0x30;

dgus_show_text_value_set(VALUATION_GRAM_ADDR၊ test_display၊ 3);

}

တခြား if(gram_display

{

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);

}

တခြား if(gram_display

{

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);

}

အခြားဆိုလျှင် (gram_display

{

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);

}

အခြားဆိုလျှင် (gram_display

{

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);

}

}

တခြား

{

dgus_show_text_value_set(VALUATION_GRAM_ADDR၊ test_display၊ 3);

}

}

 

// စုစုပေါင်းစျေးနှုန်း ပြန်လည်စတင်ပါ။

ပျက်ပြယ်သော 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

{

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);

}

အခြားဆိုလျှင် (စျေးနှုန်း_တန်ဖိုး

{

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);

}

အခြားဆိုလျှင် (စျေးနှုန်း_တန်ဖိုး

{

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);

}

အခြားဆိုလျှင် (စျေးနှုန်း_တန်ဖိုး

{

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);

}

}

တခြား

{

dgus_show_text_value_set(VALUATION_TOTAL_PRICES_ADDR၊ test_display၊ 4);

}

}

ပျက်ပြယ်သော page_valuation_decorticate()

{

valuation_decorticate = ဂရမ်_တန်ဖိုး;

page_valuation_weight_refresh();

}

ပျက်ပြယ်သော page_valuation_1()

{

if(valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 1;

page_valuation_unit_price_refresh();

}

}

ပျက်ပြယ်သော page_valuation_2()

{

if(valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 2;

page_valuation_unit_price_refresh();

}

}

ပျက်ပြယ်သော page_valuation_3()

{

if(valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 3;

page_valuation_unit_price_refresh();

}

}

ပျက်ပြယ်သော page_valuation_4()

{

if(valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 4;

page_valuation_unit_price_refresh();

}

}

ပျက်ပြယ်သော page_valuation_5()

{

if(valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 5;

page_valuation_unit_price_refresh();

}

}

ပျက်ပြယ်သော page_valuation_6()

{

if(valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 6;

page_valuation_unit_price_refresh();

}

}

ပျက်ပြယ်သော page_valuation_7()

{

if(valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 7;

page_valuation_unit_price_refresh();

}

}

ပျက်ပြယ်သော page_valuation_8()

{

if(valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 8;

page_valuation_unit_price_refresh();

}

}

ပျက်ပြယ်သော page_valuation_9()

{

if(valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 9;

page_valuation_unit_price_refresh();

}

}

ပျက်ပြယ်သော page_valuation_0()

{

if(valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 0;

page_valuation_unit_price_refresh();

}

}

ပျက်ပြယ်သော page_valuation_back()

{

valuation_unit_price = valuation_unit_price / 10;

page_valuation_unit_price_refresh();

}

ပျက်ပြယ်သော page_valuation_clear()

{

valuation_unit_price = 0;

page_valuation_unit_price_refresh();

}


တင်ချိန်- ဧပြီလ ၂၈-၂၀၂၄