[Qhib qhov chaw] Multifunctional Weighing Device

—— Los ntawm DWIN Developer Forum

Hauv qhov teeb meem no, peb thawb qhov khoom plig qhib-qhov rooj ntawm DWIN Developer Forum - Multi-function Weigher. Tus engineer txais 4-nti COF ntse npo, thiab los ntawm cov ntaub ntawv sib cuam tshuam ntawm T5L OS core thiab HX711 module thiab 5kg siab sensor teeb, cov neeg siv tau yooj yim paub cov suav cov khoom siv xws li qhov hnyav, nqi tsev, tag nrho cov nqi, tare, thiab lwm yam. ., nrog rau cov haujlwm ntawm kev suav, taug qab qhov hnyav hloov nkhaus, thiab kho qhov tseeb ntawm qhov hnyav, thiab lwm yam, kom nws yooj yim los hloov ntawm cov ntawv thov sib txawv kom txaus siab rau qhov yooj yim thiab siv tau zoo.

1. Kev txhim kho UI

f26af533d43728cd210e0f7af5e7 ua

2.C51 Tsim

Ib feem ntawm cov cai siv rau lub qhov hnyav los siv cov nqi them nqi yog raws li hauv qab no:

// Nqe Page ====

#define VALUATION_UNIT_PRICE_ADDR 0x1010

#define VALUATION_GRAM_ADDR 0x1000

#define VALUATION_TOTAL_PRICES_ADDR 0x1020

uint32_t valuation_decorticate = 0; // Tus Nqi Tare Nyhav

uint32_t valuation_unit_price = 0; // Tus nqi

// Unit Price Refresh

void page_valuation_unit_price_refresh()

{

uint8_t test_display[10] = {0};

yog tias (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);

}

Lwm tus yog tias (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);

}

Lwm tus yog tias (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);

}

Lwm tus yog tias (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);

}

}

 

// Nyhav Refresh

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 - tus nqi_decorticate;

yog tias (gram_display

{

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

dgus_show_text_value_set(VALUATION_GRAM_ADDR, test_display, 3);

}

lwm yam yog tias (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);

}

lwm yam yog tias (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);

}

yog tias (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);

}

yog tias (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);

}

}

lwm tus

{

dgus_show_text_value_set(VALUATION_GRAM_ADDR, test_display, 3);

}

}

 

// Total Price Refresh

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;

yog tias (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);

}

Lwm tus yog tias (price_value

{

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

}

Lwm tus yog tias (price_value

{

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

}

Lwm tus yog tias (price_value

{

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

}

}

lwm tus

{

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

{

yog tias (valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 1;

page_valuation_unit_price_refresh();

}

}

void page_valuation_2()

{

yog tias (valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 2;

page_valuation_unit_price_refresh();

}

}

void page_valuation_3()

{

yog tias (valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 3;

page_valuation_unit_price_refresh();

}

}

void page_valuation_4()

{

yog tias (valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 4;

page_valuation_unit_price_refresh();

}

}

void page_valuation_5()

{

yog tias (valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 5;

page_valuation_unit_price_refresh();

}

}

void page_valuation_6()

{

yog tias (valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 6;

page_valuation_unit_price_refresh();

}

}

void page_valuation_7()

{

yog tias (valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 7;

page_valuation_unit_price_refresh();

}

}

void page_valuation_8()

{

yog tias (valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 8;

page_valuation_unit_price_refresh();

}

}

void page_valuation_9()

{

yog tias (valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 9;

page_valuation_unit_price_refresh();

}

}

void page_valuation_0()

{

yog tias (valuation_unit_price

{

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

}


Lub sij hawm xa tuaj: Plaub Hlis-28-2024