[Oghere mepere emepe] Ngwaọrụ atụle ọtụtụ ọrụ

——Site na ọgbakọ Mmepụta DWIN

N'ime mbipụta a, anyị na-akwali ikpe mepere emepe na-emeri nke DWIN Developer Forum - Multi-function Weigher. Onye injinia ahụ na-enweta ihuenyo smart COF 4-inch, yana site na mmekọrịta data n'etiti T5L OS core na HX711 modul na 5kg pressure sensọ set, ndị ọrụ nwere ike ghọta ngwa ngwa ọrụ ngosipụta ọnụ dị ka ibu, ọnụahịa otu, ọnụ ahịa mkpokọta, tare, wdg. ., yana ọrụ nke ịgụta, nsuso nke mgbanwe mgbanwe arọ, na mezie nke ziri ezi, wdg, nke mere na ọ dị mfe ịgbanwe n'etiti ihe ngosi ngwa dị iche iche iji nweta ahụmahụ dị mfe ma dị irè.

1. UI mmepe

f26af533d43728cd210e0f7af5e7acc

2.C51 Imebe

Akụkụ nke koodu ntụaka maka onye ọtụ̀tụ̀ iji mejuputa ọrụ ọnụahịa bụ nke a:

// Ibe ọnụahịa =================

# kọwapụta VALUATION_UNIT_PRICE_ADDR 0x1010

# kọwapụta VALUATION_GRAM_ADDR 0x1000

# kọwapụta VALUATION_TOTAL_PRICES_ADDR 0x1020

uint32_t valuation_decorticate = 0; // Ịnye ọnụahịa Tare Ibu

uint32_t valuation_unit_price = 0; //Ọnụahịa otu

// Ntughari ọnụ ahịa nkeji

peeji efu_valuation_unit_price_refresh()

{

uint8_t test_display[10] = {0};

ọ bụrụ (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);

}

ọzọ ma ọ bụrụ (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);

}

ọzọ ma ọ bụrụ (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);

}

ọzọ ma ọ bụrụ (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);

}

}

 

// Nwee ume ibu

peeji efu_valuation_weight_refresh()

{

uint8_t test_display[10] = {0x30};

uint32_t gram_display = 0;

ọ bụrụ (gram_value>= valuation_decorticate)

{

gram_display = gram_value - valuation_decorticate;

ọ bụrụ (gram_ngosi

{

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

dgus_show_text_value_set(VALUATION_GRAM_ADDR, test_display, 3);

}

ọzọ ma ọ bụrụ (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);

}

ọzọ ma ọ bụrụ (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);

}

ọzọ ma ọ bụrụ (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);

}

ọzọ ma ọ bụrụ (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);

}

}

ọzọ

{

dgus_show_text_value_set(VALUATION_GRAM_ADDR, test_display, 3);

}

}

 

// Ngụkọta ume ọhụrụ ọnụ ahịa

peeji efu_valuation_price_refresh()

{

uint32_t price_value = 0;

uint8_t test_display[10] = {0x30, '.', 0x30, 0x30};

ọ bụrụ (gram_value>= valuation_decorticate)

{

price_value = (gram_value - valuation_decorticate) * valuation_unit_price * 2/1000;

ọ bụrụ (ọnụahịa_ọnụahịa

{

test_display[0] = price_uru / 100% 10 + 0x30;

test_display[1] = '.';

test_display[2] = price_uru / 10% 10 + 0x30;

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

dgus_show_text_value_set(VALUATION_TOTAL_PRICES_ADDR, test_display, 4);

}

ọzọ ma ọ bụrụ (ọnụahịa_ọnụahịa

{

test_display[0] = price_uru / 1000% 10 + 0x30;

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

test_display[2] = '.';

test_display[3] = price_uru / 10% 10 + 0x30;

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

dgus_show_text_value_set(VALUATION_TOTAL_PRICES_ADDR, test_display, 4);

}

ọzọ ma ọ bụrụ (ọnụahịa_uru

{

test_display[0] = price_uru / 10000% 10 + 0x30;

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

test_display[2] = price_uru / 100% 10 + 0x30;

test_display[3] = '.';

test_display[4] = price_uru / 10% 10 + 0x30;

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

dgus_show_text_value_set(VALUATION_TOTAL_PRICES_ADDR, test_display, 4);

}

ọzọ ma ọ bụrụ (ọnụahịa_uru

{

test_display[0] = price_uru / 100000% 10 + 0x30;

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

test_display[2] = price_uru / 1000% 10 + 0x30;

test_display[3] = price_uru / 100% 10 + 0x30;

test_display[4] = '.';

test_display[5] = price_uru / 10% 10 + 0x30;

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

dgus_show_text_value_set(VALUATION_TOTAL_PRICES_ADDR, test_display, 4);

}

}

ọzọ

{

dgus_show_text_value_set(VALUATION_TOTAL_PRICES_ADDR, test_display, 4);

}

}

ihe efu page_valuation_decorticate()

{

valuation_decorticate = gram_value;

ibe_valuation_weight_refresh();

}

peeji efu_valuation_1()

{

ọ bụrụ na (valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 1;

ibe_valuation_unit_price_refresh();

}

}

peeji efu_valuation_2()

{

ọ bụrụ na (valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 2;

ibe_valuation_unit_price_refresh();

}

}

peeji efu_valuation_3()

{

ọ bụrụ na (valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 3;

ibe_valuation_unit_price_refresh();

}

}

peeji efu_valuation_4()

{

ọ bụrụ na (valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 4;

ibe_valuation_unit_price_refresh();

}

}

peeji efu_valuation_5()

{

ọ bụrụ na (valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 5;

ibe_valuation_unit_price_refresh();

}

}

peeji efu_valuation_6()

{

ọ bụrụ na (valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 6;

ibe_valuation_unit_price_refresh();

}

}

peeji efu_valuation_7()

{

ọ bụrụ na (valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 7;

ibe_valuation_unit_price_refresh();

}

}

peeji efu_valuation_8()

{

ọ bụrụ na (valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 8;

ibe_valuation_unit_price_refresh();

}

}

peeji efu_valuation_9()

{

ọ bụrụ na (valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 9;

ibe_valuation_unit_price_refresh();

}

}

peeji efu_valuation_0()

{

ọ bụrụ na (valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 0;

ibe_valuation_unit_price_refresh();

}

}

peeji efu_valuation_back()

{

valuation_unit_price = valuation_unit_price / 10;

ibe_valuation_unit_price_refresh();

}

peeji efu_valuation_clear()

{

valuation_unit_price = 0;

ibe_valuation_unit_price_refresh();

}


Oge nzipu: Eprel-28-2024