[திறந்த மூல] மல்டிஃபங்க்ஸ்னல் எடையிடும் சாதனம்

——DWIN டெவலப்பர் மன்றத்திலிருந்து

இந்த இதழில், DWIN டெவலப்பர் ஃபோரம் - மல்டி ஃபங்ஷன் வெய்யரின் விருது பெற்ற ஓப்பன் சோர்ஸ் கேஸை நாங்கள் முன்வைக்கிறோம். பொறியாளர் 4-இன்ச் COF ஸ்மார்ட் ஸ்கிரீனை ஏற்றுக்கொள்கிறார், மேலும் T5L OS கோர் மற்றும் HX711 மாட்யூல் மற்றும் 5kg பிரஷர் சென்சார் செட் ஆகியவற்றுக்கு இடையேயான தரவு தொடர்பு மூலம், எடை, யூனிட் விலை, மொத்த விலை, டேர் போன்ற எண்ணும் காட்சி செயல்பாடுகளை பயனர்கள் எளிதாக உணர முடியும். ., அதே போல் எண்ணுதல், எடை மாற்ற வளைவுகளைக் கண்காணித்தல் மற்றும் எடையின் துல்லியத்தை சரிசெய்தல் போன்ற செயல்பாடுகள், இதனால் வசதியான மற்றும் திறமையான எடை அனுபவத்தை அனுபவிக்க வெவ்வேறு பயன்பாட்டு காட்சிகளுக்கு இடையில் மாறுவது எளிது.

1. UI மேம்பாடு

f26af533d43728cd210e0f7af5e7acc

2.C51 வடிவமைப்பு

விலையிடல் செயல்பாட்டை செயல்படுத்த எடையூட்டுபவர்க்கான குறிப்புக் குறியீட்டின் ஒரு பகுதி பின்வருமாறு:

// விலை பக்கம்=====================

#VALUATION_UNIT_PRICE_ADDR 0x1010ஐ வரையறுக்கவும்

#VALUATION_GRAM_ADDR 0x1000ஐ வரையறுக்கவும்

#VALUATION_TOTAL_PRICES_ADDR 0x1020ஐ வரையறுக்கவும்

uint32_t valuation_decorticate = 0; // விலை தாரே எடை

uint32_t valuation_unit_price = 0; //அலகு விலை

// யூனிட் விலை புதுப்பிப்பு

void page_valuation_unit_price_refresh()

{

uint8_t test_display[10] = {0};

என்றால்(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);

}

}

 

// எடை புதுப்பிப்பு

void page_valuation_weight_refresh()

{

uint8_t test_display[10] = {0x30};

uint32_t gram_display = 0;

என்றால்(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);

}

இல்லையெனில் (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);

}

இல்லையெனில் (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);

}

}

 

// மொத்த விலை புதுப்பிப்பு

void page_valuation_price_refresh()

{

uint32_t price_value = 0;

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

என்றால்(gram_value >= valuation_decorticate)

{

விலை_மதிப்பு = (gram_value - valuation_decorticate) * valuation_unit_price * 2 / 1000;

என்றால் (விலை_மதிப்பு

{

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

}

}

void page_valuation_decorticate()

{

valuation_decorticate = gram_value;

page_valuation_weight_refresh();

}

void page_valuation_1()

{

என்றால்(valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 1;

page_valuation_unit_price_refresh();

}

}

void page_valuation_2()

{

என்றால்(valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 2;

page_valuation_unit_price_refresh();

}

}

void page_valuation_3()

{

என்றால்(valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 3;

page_valuation_unit_price_refresh();

}

}

void page_valuation_4()

{

என்றால்(valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 4;

page_valuation_unit_price_refresh();

}

}

void page_valuation_5()

{

என்றால்(valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 5;

page_valuation_unit_price_refresh();

}

}

void page_valuation_6()

{

என்றால்(valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 6;

page_valuation_unit_price_refresh();

}

}

void page_valuation_7()

{

என்றால்(valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 7;

page_valuation_unit_price_refresh();

}

}

void page_valuation_8()

{

என்றால்(valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 8;

page_valuation_unit_price_refresh();

}

}

void page_valuation_9()

{

என்றால்(valuation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 9;

page_valuation_unit_price_refresh();

}

}

void page_valuation_0()

{

என்றால்(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();

}


பின் நேரம்: ஏப்-28-2024