——Ukusuka kwiQonga labaphuhlisi be-DWIN
Kolu shicilelo, sityhala imbasa-yetyala elivulelekileyo leQonga loMphuhlisi le-DWIN-I-Multi-function Weigher. Injineli ithatha i-4-intshi ye-COF smart screen, kwaye ngokusebenzisana kwedatha phakathi kwe-T5L OS core kunye ne-HX711 imodyuli kunye ne-5kg i-sensor sensor set, abasebenzisi banokuqonda ngokulula imisebenzi yokubonisa ukubala njengobunzima, ixabiso leyunithi, ixabiso lilonke, i-tare, njl. ., kunye nemisebenzi yokubala, ukulandelwa kwee-curves zokutshintsha ubunzima, kunye nokulungiswa kokuchaneka kwe-weigher, njl., ukwenzela ukuba kube lula ukutshintshela phakathi kweemeko zesicelo ezahlukeneyo ukuze ujabulele amava afanelekileyo kunye asebenzayo okulinganisa.
1. Uphuhliso lwe-UI
![f26af533d43728cd210e0f7af5e7acc](https://ecdn6.globalso.com/upload/p/1355/source/2024-06/665f077223d2b27894.png)
2.C51 Uyilo
Inxalenye yekhowudi yereferensi yomlinganiso wokuphumeza umsebenzi wexabiso ngolu hlobo lulandelayo:
// Iphepha lamaxabiso=====================
#chaza VALUE_UNIT_PRICE_ADDR 0x1010
#chaza VALUE_GRAM_ADDR 0x1000
#chaza VALUE_TOTAL_PRICES_ADDR 0x1020
uint32_t valuation_decorticate = 0; // Amaxabiso Ubunzima beTare
uint32_t valuation_unit_price = 0; //Ixabiso lento
// Ukuhlaziywa kwexabiso leyunithi
iphepha elingenanto_valuation_unit_price_refresh()
{
uint8_t test_display[10] = {0};
ukuba(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(VALUE_UNIT_PRICE_ADDR, test_display, 4);
}
ngenye indlela ukuba(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(VALUE_UNIT_PRICE_ADDR, test_display, 4);
}
ngenye indlela ukuba(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(VALUE_UNIT_PRICE_ADDR, test_display, 4);
}
ngenye indlela ukuba(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(VALUE_UNIT_PRICE_ADDR, test_display, 4);
}
}
// Ukuhlaziya ubunzima
iphepha elingenanto_valuation_weight_refresh ()
{
uint8_t test_display[10] = {0x30};
uint32_t gram_display = 0;
ukuba(ixabiso_legram>= ixabiso_lokuhombisa)
{
igram_display = igram_value - valuation_decorticate;
ukuba(igram_bonisa
{
test_display[0] = gram_display / 1 % 10 + 0x30;
dgus_show_text_value_set(VALUE_GRAM_ADDR, test_display, 3);
}
ngenye indlela ukuba(igram_display
{
test_display[0] = gram_display / 10 % 10 + 0x30;
test_display[1] = gram_display / 1 % 10 + 0x30;
dgus_show_text_value_set(VALUE_GRAM_ADDR, test_display, 3);
}
ngenye indlela ukuba(igram_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(VALUE_GRAM_ADDR, test_display, 3);
}
ngenye indlela ukuba(igram_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(VALUE_GRAM_ADDR, test_display, 3);
}
ngenye indlela ukuba(igram_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(VALUE_GRAM_ADDR, test_display, 3);
}
}
enye into
{
dgus_show_text_value_set(VALUE_GRAM_ADDR, test_display, 3);
}
}
// Ixabiso lilonke lokuHlaziya
iphepha elingenanto_valuation_price_refresh()
{
uint32_t price_value = 0;
uint8_t test_display[10] = {0x30, '.', 0x30, 0x30};
ukuba(ixabiso_legram>= ixabiso_lokuhombisa)
{
ixabiso_ixabiso = (igram_value - valuation_decorticate) * valuation_unit_price * 2 / 1000;
ukuba(ixabiso_ixabiso
{
test_display[0] = ixabiso_ixabiso / 100 % 10 + 0x30;
test_display[1] = '.';
test_display[2] = ixabiso_ixabiso / 10 % 10 + 0x30;
test_display[3] = ixabiso_ixabiso / 1% 10 + 0x30;
dgus_show_text_value_set(VALUE_TOTAL_PRICES_ADDR, test_display, 4);
}
ngenye indlela ukuba(ixabiso_ixabiso
{
test_display[0] = ixabiso_ixabiso / 1000 % 10 + 0x30;
test_display[1] = ixabiso_ixabiso / 100 % 10 + 0x30;
test_display[2] = '.';
test_display[3] = ixabiso_ixabiso / 10 % 10 + 0x30;
test_display[4] = ixabiso_ixabiso / 1% 10 + 0x30;
dgus_show_text_value_set(VALUE_TOTAL_PRICES_ADDR, test_display, 4);
}
ngenye indlela ukuba(ixabiso_ixabiso
{
test_display[0] = ixabiso_ixabiso / 10000 % 10 + 0x30;
test_display[1] = ixabiso_ixabiso / 1000 % 10 + 0x30;
test_display[2] = ixabiso_ixabiso / 100 % 10 + 0x30;
test_display[3] = '.';
test_display[4] = ixabiso_ixabiso / 10 % 10 + 0x30;
test_display[5] = ixabiso_ixabiso / 1% 10 + 0x30;
dgus_show_text_value_set(VALUE_TOTAL_PRICES_ADDR, test_display, 4);
}
ngenye indlela ukuba(ixabiso_ixabiso
{
test_display[0] = ixabiso_ixabiso / 100000 % 10 + 0x30;
test_display[1] = ixabiso_ixabiso / 10000 % 10 + 0x30;
test_display[2] = ixabiso_ixabiso / 1000 % 10 + 0x30;
test_display[3] = ixabiso_ixabiso / 100 % 10 + 0x30;
test_display[4] = '.';
test_display[5] = ixabiso_ixabiso / 10 % 10 + 0x30;
test_display[6] = ixabiso_ixabiso / 1% 10 + 0x30;
dgus_show_text_value_set(VALUE_TOTAL_PRICES_ADDR, test_display, 4);
}
}
enye into
{
dgus_show_text_value_set(VALUE_TOTAL_PRICES_ADDR, test_display, 4);
}
}
iphepha elingenanto_valuation_decorticate()
{
valuation_decorticate = gram_value;
page_valuation_weight_refresh();
}
iphepha elingenanto_valuation_1()
{
ukuba(valuation_unit_price
{
valuation_unit_price = valuation_unit_price * 10 + 1;
page_valuation_unit_price_refresh();
}
}
iphepha elingenanto_valuation_2()
{
ukuba(valuation_unit_price
{
valuation_unit_price = valuation_unit_price * 10 + 2;
page_valuation_unit_price_refresh();
}
}
iphepha elingenanto_valuation_3()
{
ukuba(valuation_unit_price
{
valuation_unit_price = valuation_unit_price * 10 + 3;
page_valuation_unit_price_refresh();
}
}
iphepha elingenanto_valuation_4()
{
ukuba(valuation_unit_price
{
valuation_unit_price = valuation_unit_price * 10 + 4;
page_valuation_unit_price_refresh();
}
}
iphepha elingenanto_valuation_5()
{
ukuba(valuation_unit_price
{
valuation_unit_price = valuation_unit_price * 10 + 5;
page_valuation_unit_price_refresh();
}
}
iphepha elingenanto_valuation_6()
{
ukuba(valuation_unit_price
{
valuation_unit_price = valuation_unit_price * 10 + 6;
page_valuation_unit_price_refresh();
}
}
iphepha elingenanto_valuation_7()
{
ukuba(valuation_unit_price
{
valuation_unit_price = valuation_unit_price * 10 + 7;
page_valuation_unit_price_refresh();
}
}
iphepha elingenanto_valuation_8()
{
ukuba(valuation_unit_price
{
valuation_unit_price = valuation_unit_price * 10 + 8;
page_valuation_unit_price_refresh();
}
}
iphepha elingenanto_valuation_9()
{
ukuba(valuation_unit_price
{
valuation_unit_price = valuation_unit_price * 10 + 9;
page_valuation_unit_price_refresh();
}
}
iphepha elingenanto_valuation_0()
{
ukuba(valuation_unit_price
{
valuation_unit_price = valuation_unit_price * 10 + 0;
page_valuation_unit_price_refresh();
}
}
iphepha elingenanto_valuation_back()
{
valuation_unit_price = valuation_unit_price / 10;
page_valuation_unit_price_refresh();
}
iphepha elingenanto_valuation_clear()
{
valuation_unit_price = 0;
page_valuation_unit_price_refresh();
}
Ixesha lokuposa: Apr-28-2024