[खुला स्रोत] बहुकार्यात्मक तौल उपकरण

——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};

यदि (मूल्यांकन_इकाई_मूल्य

{

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_display = gram_value - valuation_decorticate;

यदि(ग्राम_डिस्प्ले

{

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

dgus_show_text_value_set(VALUATION_GRAM_ADDR, test_display, 3);

}

अन्यथा यदि (ग्राम_डिस्प्ले

{

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

}

अन्यथा यदि (ग्राम_डिस्प्ले

{

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

}

अन्यथा यदि (ग्राम_डिस्प्ले

{

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

}

अन्यथा यदि (ग्राम_डिस्प्ले

{

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

यदि (ग्राम_मूल्य >= मूल्याङ्कन_डेकोर्टीकेट)

{

मूल्य_मूल्य = (ग्राम_मूल्य - मूल्याङ्कन_डेकोर्टिकेट) * मूल्याङ्कन_एकाइ_मूल्य * 2 / 1000;

यदि (मूल्य_मान

{

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

test_display[1] = '।';

परीक्षण_प्रदर्शन[2] = मूल्य_मान / 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;

परीक्षण_प्रदर्शन[1] = मूल्य_मान / १००% १० + ०x३०;

test_display[2] = '।';

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

test_display[4] = मूल्य_मान / 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;

परीक्षण_प्रदर्शन[2] = मूल्य_मान / १००% १० + ०x३०;

test_display[3] = '।';

परीक्षण_प्रदर्शन[४] = मूल्य_मान / १०% १० + ०x३०;

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] = मूल्य_मान / 10000 % 10 + 0x30;

test_display[2] = मूल्य_मान / 1000 % 10 + 0x30;

परीक्षण_प्रदर्शन[3] = मूल्य_मान / 100% 10 + 0x30;

test_display[4] = '।';

परीक्षण_प्रदर्शन[5] = मूल्य_मान / 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 = ग्राम_मूल्य;

page_valuation_weight_refresh();

}

void page_valuation_1()

{

यदि (मूल्यांकन_इकाई_मूल्य

{

valuation_unit_price = valuation_unit_price * 10 + 1;

page_valuation_unit_price_refresh();

}

}

void page_valuation_2()

{

यदि (मूल्यांकन_इकाई_मूल्य

{

valuation_unit_price = valuation_unit_price * 10 + 2;

page_valuation_unit_price_refresh();

}

}

void page_valuation_3()

{

यदि (मूल्यांकन_इकाई_मूल्य

{

valuation_unit_price = valuation_unit_price * 10 + 3;

page_valuation_unit_price_refresh();

}

}

void page_valuation_4()

{

यदि (मूल्यांकन_इकाई_मूल्य

{

valuation_unit_price = valuation_unit_price * 10 + 4;

page_valuation_unit_price_refresh();

}

}

void page_valuation_5()

{

यदि (मूल्यांकन_इकाई_मूल्य

{

valuation_unit_price = valuation_unit_price * 10 + 5;

page_valuation_unit_price_refresh();

}

}

void page_valuation_6()

{

यदि (मूल्यांकन_इकाई_मूल्य

{

valuation_unit_price = valuation_unit_price * 10 + 6;

page_valuation_unit_price_refresh();

}

}

void page_valuation_7()

{

यदि (मूल्यांकन_इकाई_मूल्य

{

valuation_unit_price = valuation_unit_price * 10 + 7;

page_valuation_unit_price_refresh();

}

}

void page_valuation_8()

{

यदि (मूल्यांकन_इकाई_मूल्य

{

valuation_unit_price = valuation_unit_price * 10 + 8;

page_valuation_unit_price_refresh();

}

}

void page_valuation_9()

{

यदि (मूल्यांकन_इकाई_मूल्य

{

valuation_unit_price = valuation_unit_price * 10 + 9;

page_valuation_unit_price_refresh();

}

}

void page_valuation_0()

{

यदि (मूल्यांकन_इकाई_मूल्य

{

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