——Lati Apejọ Olùgbéejáde DWIN
Ninu atẹjade yii, a Titari ọran orisun-ìmọ ti o gba ẹbun ti Apejọ Olùgbéejáde DWIN - Multi-function Weigher. Ẹlẹrọ naa gba iboju smart COF 4-inch COF, ati nipasẹ ibaraenisepo data laarin T5L OS mojuto ati HX711 module ati 5kg titẹ sensọ ṣeto, awọn olumulo le ni rọọrun mọ awọn iṣẹ ifihan kika bi iwuwo, idiyele ẹyọkan, idiyele lapapọ, tare, bbl ., bakannaa awọn iṣẹ ti kika, ipasẹ awọn iyipo iyipada iwuwo, ati atunṣe deede iwuwo, ati bẹbẹ lọ, nitorinaa o rọrun lati yipada laarin awọn oju iṣẹlẹ ohun elo oriṣiriṣi lati gbadun irọrun ati iriri iwọn lilo daradara.
1. UI Idagbasoke
![f26af533d43728cd210e0f7af5e7acc](https://ecdn6.globalso.com/upload/p/1355/source/2024-06/665f077223d2b27894.png)
2.C51 Oniru
Apakan koodu itọkasi fun oniwon lati ṣe iṣẹ ṣiṣe idiyele jẹ atẹle yii:
// Oju-iwe Ifowoleri =================
# asọye VALUATION_UNIT_PRICE_ADDR 0x1010
# asọye VALUATION_GRAM_ADDR 0x1000
# ṣe asọye VALUATION_TOTAL_PRICES_ADDR 0x1020
uint32_t valuation_decorticate = 0; // Ifowoleri Tare iwuwo
uint32_t valuation_unit_price = 0; //Oye eyo kan
// Unit Price Sọ
ofo oju-iwe_valuation_unit_price_refresh()
{
uint8_t test_display[10] = {0};
ti(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);
}
miiran ti (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);
}
miiran ti (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);
}
miiran ti (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);
}
}
// Àdánù Sọ
ofo oju ewe_valuation_weight_refresh()
{
uint8_t test_display[10] = {0x30};
uint32_t gram_display = 0;
ti (gram_value>=valuation_decorticate)
{
gram_display = gram_value - valuation_decorticate;
ti (giramu_ifihan
{
test_display[0] = giramu_display / 1% 10 + 0x30;
dgus_show_text_value_set (VALUATION_GRAM_ADDR, test_display, 3);
}
bibẹẹkọ ti (gram_display
{
test_display[0] = giramu_display / 10% 10 + 0x30;
test_display [1] = giramu_display / 1% 10 + 0x30;
dgus_show_text_value_set (VALUATION_GRAM_ADDR, test_display, 3);
}
bibẹẹkọ ti (gram_display
{
test_display[0] = giramu_display / 100% 10 + 0x30;
test_display[1] = giramu_display / 10% 10 + 0x30;
test_display[2] = giramu_display / 1% 10 + 0x30;
dgus_show_text_value_set (VALUATION_GRAM_ADDR, test_display, 3);
}
bibẹẹkọ ti (gram_display
{
test_display[0] = giramu_display / 1000% 10 + 0x30;
test_display[1] = giramu_display / 100% 10 + 0x30;
test_display[2] = giramu_display / 10% 10 + 0x30;
test_display[3] = giramu_display / 1% 10 + 0x30;
dgus_show_text_value_set (VALUATION_GRAM_ADDR, test_display, 3);
}
bibẹẹkọ ti (gram_display
{
test_display[0] = giramu_display / 10000% 10 + 0x30;
test_display[1] = giramu_display / 1000% 10 + 0x30;
test_display[2] = giramu_display / 100% 10 + 0x30;
test_display[3] = giramu_display / 10% 10 + 0x30;
test_display[4] = giramu_display / 1% 10 + 0x30;
dgus_show_text_value_set (VALUATION_GRAM_ADDR, test_display, 3);
}
}
miiran
{
dgus_show_text_value_set (VALUATION_GRAM_ADDR, test_display, 3);
}
}
// Lapapọ Iye Sọ
ofo oju-iwe_valuation_price_refresh()
{
uint32_t price_value = 0;
uint8_t test_display[10] = {0x30, '.', 0x30, 0x30};
ti (gram_value>=valuation_decorticate)
{
price_value = (gram_value - valuation_decorticate) * valuation_unit_price * 2/1000;
ti(iye_iye
{
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);
}
bibẹẹkọ ti (iye_iye
{
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);
}
bibẹẹkọ ti (iye_iye
{
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);
}
miiran ti (iye_iye
{
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);
}
}
miiran
{
dgus_show_text_value_set (VALUATION_TOTAL_PRICES_ADDR, test_display, 4);
}
}
ofo oju-iwe_valuation_decorticate()
{
valuation_decorticate = gram_value;
page_valuation_weight_refresh ();
}
ofo oju iwe_valuation_1()
{
ti(valuation_unit_price
{
valuation_unit_price = valuation_unit_price * 10 + 1;
page_valuation_unit_price_refresh ();
}
}
ofo oju iwe_valuation_2()
{
ti(valuation_unit_price
{
valuation_unit_price = valuation_unit_price * 10 + 2;
page_valuation_unit_price_refresh ();
}
}
ofo oju iwe_valuation_3()
{
ti(valuation_unit_price
{
valuation_unit_price = valuation_unit_price * 10 + 3;
page_valuation_unit_price_refresh ();
}
}
ofo oju-iwe_valuation_4()
{
ti(valuation_unit_price
{
valuation_unit_price = valuation_unit_price * 10 + 4;
page_valuation_unit_price_refresh ();
}
}
ofo oju iwe_valuation_5()
{
ti(valuation_unit_price
{
valuation_unit_price = valuation_unit_price * 10 + 5;
page_valuation_unit_price_refresh ();
}
}
ofo oju iwe_valuation_6()
{
ti(valuation_unit_price
{
valuation_unit_price = valuation_unit_price * 10 + 6;
page_valuation_unit_price_refresh ();
}
}
ofo oju iwe_valuation_7()
{
ti(valuation_unit_price
{
valuation_unit_price = valuation_unit_price * 10 + 7;
page_valuation_unit_price_refresh ();
}
}
ofo oju iwe_valuation_8()
{
ti(valuation_unit_price
{
valuation_unit_price = valuation_unit_price * 10 + 8;
page_valuation_unit_price_refresh ();
}
}
ofo oju-iwe_valuation_9()
{
ti(valuation_unit_price
{
valuation_unit_price = valuation_unit_price * 10 + 9;
page_valuation_unit_price_refresh ();
}
}
ofo oju iwe_valuation_0()
{
ti(valuation_unit_price
{
valuation_unit_price = valuation_unit_price * 10 + 0;
page_valuation_unit_price_refresh ();
}
}
ofo oju-iwe_valuation_pada()
{
valuation_unit_price = valuation_unit_price / 10;
page_valuation_unit_price_refresh ();
}
ofo oju-iwe_valuation_clear()
{
valuation_unit_price = 0;
page_valuation_unit_price_refresh ();
}
Akoko ifiweranṣẹ: Oṣu Kẹrin Ọjọ 28-2024