[ওপেন সোর্স] মাল্টিফাংশনাল ওয়েইং ডিভাইস

—— DWIN ডেভেলপার ফোরাম থেকে

এই ইস্যুতে, আমরা DWIN ডেভেলপার ফোরাম - মাল্টি-ফাংশন ওয়েজার-এর পুরস্কার বিজয়ী ওপেন-সোর্স কেসটি পুশ করি। প্রকৌশলী একটি 4-ইঞ্চি COF স্মার্ট স্ক্রিন গ্রহণ করেন এবং T5L OS কোর এবং HX711 মডিউল এবং 5kg চাপ সেন্সর সেটের মধ্যে ডেটা মিথস্ক্রিয়া দ্বারা, ব্যবহারকারীরা সহজেই কাউন্টিং ডিসপ্লে ফাংশন যেমন ওজন, ইউনিটের মূল্য, মোট মূল্য, টায়ার ইত্যাদি উপলব্ধি করতে পারে। ., সেইসাথে গণনার ফাংশন, ওজন পরিবর্তন বক্ররেখার ট্র্যাকিং, এবং ওজনের নির্ভুলতা সংশোধন করা ইত্যাদি, যাতে একটি সুবিধাজনক এবং দক্ষ ওজন অভিজ্ঞতা উপভোগ করতে বিভিন্ন অ্যাপ্লিকেশন পরিস্থিতিগুলির মধ্যে পরিবর্তন করা সহজ হয়৷

1. UI উন্নয়ন

f26af533d43728cd210e0f7af5e7acc

2.C51 ডিজাইন

মূল্য নির্ধারণ ফাংশন বাস্তবায়ন করার জন্য ওজনকারীর জন্য রেফারেন্স কোডের অংশ নিম্নরূপ:

// মূল্য নির্ধারণ পৃষ্ঠা====================

#মূল্যায়ন_UNIT_PRICE_ADDR 0x1010 সংজ্ঞায়িত করুন

#মূল্যায়ন_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);

}

অন্যথায় যদি (মূল্যায়ন_ইউনিট_মূল্য

{

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

}

অন্যথায় যদি (মূল্যায়ন_ইউনিট_মূল্য

{

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

}

অন্যথায় যদি (মূল্যায়ন_ইউনিট_মূল্য

{

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

যদি (গ্রাম_মূল্য >= মূল্যায়ন_সজ্জা)

{

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

যদি (মূল্য_মূল্য

{

test_display[0] = মূল্য_মান / 100% 10 + 0x30;

test_display[1] = '.';

test_display[2] = মূল্য_মান / 10% 10 + 0x30;

test_display[3] = মূল্য_মান / 1% 10 + 0x30;

dgus_show_text_value_set(VALUATION_TOTAL_PRICES_ADDR, test_display, 4);

}

অন্যথায় যদি (মূল্য_মূল্য

{

test_display[0] = মূল্য_মান / 1000 % 10 + 0x30;

test_display[1] = মূল্য_মান / 100% 10 + 0x30;

test_display[2] = '.';

test_display[3] = মূল্য_মান / 10% 10 + 0x30;

test_display[4] = মূল্য_মান / 1% 10 + 0x30;

dgus_show_text_value_set(VALUATION_TOTAL_PRICES_ADDR, test_display, 4);

}

অন্যথায় যদি (মূল্য_মূল্য

{

test_display[0] = মূল্য_মান / 10000 % 10 + 0x30;

test_display[1] = মূল্য_মান / 1000% 10 + 0x30;

test_display[2] = মূল্য_মান / 100% 10 + 0x30;

test_display[3] = '.';

test_display[4] = মূল্য_মান / 10% 10 + 0x30;

test_display[5] = মূল্য_মান / 1% 10 + 0x30;

dgus_show_text_value_set(VALUATION_TOTAL_PRICES_ADDR, test_display, 4);

}

অন্যথায় যদি (মূল্য_মূল্য

{

test_display[0] = মূল্য_মান / 100000 % 10 + 0x30;

test_display[1] = মূল্য_মান / 10000 % 10 + 0x30;

test_display[2] = মূল্য_মান / 1000% 10 + 0x30;

test_display[3] = মূল্য_মান / 100% 10 + 0x30;

test_display[4] = '.';

test_display[5] = মূল্য_মান / 10% 10 + 0x30;

test_display[6] = মূল্য_মান / 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();

}

অকার্যকর পৃষ্ঠা_মূল্যায়ন_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();

}


পোস্টের সময়: এপ্রিল-২৮-২০২৪