[ఓపెన్ సోర్స్] మల్టీఫంక్షనల్ బరువు పరికరం

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

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

}

లేకపోతే (valueation_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);

}

లేకపోతే (valueation_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);

}

లేకపోతే (valueation_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;

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

if(gram_value >= valuation_decorticate)

{

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

}

లేకపోతే (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);

}

లేకపోతే (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);

}

}

లేకపోతే

{

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

{

if(valueation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 1;

page_valuation_unit_price_refresh();

}

}

void page_valuation_2()

{

if(valueation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 2;

page_valuation_unit_price_refresh();

}

}

void page_valuation_3()

{

if(valueation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 3;

page_valuation_unit_price_refresh();

}

}

void page_valuation_4()

{

if(valueation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 4;

page_valuation_unit_price_refresh();

}

}

శూన్యం page_valuation_5()

{

if(valueation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 5;

page_valuation_unit_price_refresh();

}

}

void page_valuation_6()

{

if(valueation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 6;

page_valuation_unit_price_refresh();

}

}

శూన్యం page_valuation_7()

{

if(valueation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 7;

page_valuation_unit_price_refresh();

}

}

void page_valuation_8()

{

if(valueation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 8;

page_valuation_unit_price_refresh();

}

}

void page_valuation_9()

{

if(valueation_unit_price

{

valuation_unit_price = valuation_unit_price * 10 + 9;

page_valuation_unit_price_refresh();

}

}

void page_valuation_0()

{

if(valueation_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