——DWIN ಡೆವಲಪರ್ ಫೋರಮ್ನಿಂದ
ಈ ಸಂಚಿಕೆಯಲ್ಲಿ, ನಾವು DWIN ಡೆವಲಪರ್ ಫೋರಮ್ನ ಪ್ರಶಸ್ತಿ-ವಿಜೇತ ಓಪನ್-ಸೋರ್ಸ್ ಕೇಸ್ ಅನ್ನು ತಳ್ಳುತ್ತೇವೆ - ಮಲ್ಟಿ-ಫಂಕ್ಷನ್ ವೇಗರ್. ಇಂಜಿನಿಯರ್ 4-ಇಂಚಿನ COF ಸ್ಮಾರ್ಟ್ ಸ್ಕ್ರೀನ್ ಅನ್ನು ಅಳವಡಿಸಿಕೊಳ್ಳುತ್ತಾರೆ ಮತ್ತು T5L OS ಕೋರ್ ಮತ್ತು HX711 ಮಾಡ್ಯೂಲ್ ಮತ್ತು 5kg ಒತ್ತಡದ ಸಂವೇದಕ ಸೆಟ್ ನಡುವಿನ ಡೇಟಾ ಸಂವಹನದ ಮೂಲಕ ಬಳಕೆದಾರರು ತೂಕ, ಘಟಕ ಬೆಲೆ, ಒಟ್ಟು ಬೆಲೆ, ಟೇರ್ ಇತ್ಯಾದಿಗಳಂತಹ ಎಣಿಕೆಯ ಪ್ರದರ್ಶನ ಕಾರ್ಯಗಳನ್ನು ಸುಲಭವಾಗಿ ಅರಿತುಕೊಳ್ಳಬಹುದು. ., ಹಾಗೆಯೇ ಎಣಿಕೆಯ ಕಾರ್ಯಗಳು, ತೂಕ ಬದಲಾವಣೆಯ ವಕ್ರಾಕೃತಿಗಳ ಟ್ರ್ಯಾಕಿಂಗ್ ಮತ್ತು ತೂಕದ ನಿಖರತೆಯನ್ನು ಸರಿಪಡಿಸುವುದು ಇತ್ಯಾದಿ. ಇದರಿಂದ ಅನುಕೂಲಕರ ಮತ್ತು ಪರಿಣಾಮಕಾರಿ ತೂಕದ ಅನುಭವವನ್ನು ಆನಂದಿಸಲು ವಿಭಿನ್ನ ಅಪ್ಲಿಕೇಶನ್ ಸನ್ನಿವೇಶಗಳ ನಡುವೆ ಬದಲಾಯಿಸುವುದು ಸುಲಭವಾಗಿದೆ.
1. UI ಅಭಿವೃದ್ಧಿ
![f26af533d43728cd210e0f7af5e7acc](https://ecdn6.globalso.com/upload/p/1355/source/2024-06/665f077223d2b27894.png)
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; //ಯುನಿಟ್ ಬೆಲೆ
// ಯುನಿಟ್ ಬೆಲೆ ರಿಫ್ರೆಶ್
ಅನೂರ್ಜಿತ 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);
}
}
// ತೂಕ ರಿಫ್ರೆಶ್
ಅನೂರ್ಜಿತ page_valuation_weight_refresh()
{
uint8_t test_display[10] = {0x30};
uint32_t gram_display = 0;
ವೇಳೆ(ಗ್ರಾಂ_ಮೌಲ್ಯ >= ಮೌಲ್ಯಮಾಪನ_ಡಿಕಾರ್ಟಿಕೇಟ್)
{
gram_display = gram_value - ಮೌಲ್ಯಮಾಪನ_decorticate;
if(gram_display
{
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);
}
}
// ಒಟ್ಟು ಬೆಲೆ ರಿಫ್ರೆಶ್
ಅನೂರ್ಜಿತ 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;
if(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);
}
ಇಲ್ಲದಿದ್ದರೆ (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);
}
ಇಲ್ಲದಿದ್ದರೆ (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);
}
}
ಅನೂರ್ಜಿತ page_valuation_decorticate()
{
ಮೌಲ್ಯಮಾಪನ_ಡಿಕಾರ್ಟಿಕೇಟ್ = ಗ್ರಾಂ_ಮೌಲ್ಯ;
page_valuation_weight_refresh();
}
ಅನೂರ್ಜಿತ page_valuation_1()
{
if(valuation_unit_price
{
valuation_unit_price = valuation_unit_price * 10 + 1;
page_valuation_unit_price_refresh();
}
}
ಅನೂರ್ಜಿತ page_valuation_2()
{
if(valuation_unit_price
{
valuation_unit_price = valuation_unit_price * 10 + 2;
page_valuation_unit_price_refresh();
}
}
ಅನೂರ್ಜಿತ page_valuation_3()
{
if(valuation_unit_price
{
valuation_unit_price = valuation_unit_price * 10 + 3;
page_valuation_unit_price_refresh();
}
}
ಅನೂರ್ಜಿತ page_valuation_4()
{
if(valuation_unit_price
{
valuation_unit_price = valuation_unit_price * 10 + 4;
page_valuation_unit_price_refresh();
}
}
ಅನೂರ್ಜಿತ page_valuation_5()
{
if(valuation_unit_price
{
valuation_unit_price = valuation_unit_price * 10 + 5;
page_valuation_unit_price_refresh();
}
}
ಅನೂರ್ಜಿತ page_valuation_6()
{
if(valuation_unit_price
{
valuation_unit_price = valuation_unit_price * 10 + 6;
page_valuation_unit_price_refresh();
}
}
ಅನೂರ್ಜಿತ page_valuation_7()
{
if(valuation_unit_price
{
valuation_unit_price = valuation_unit_price * 10 + 7;
page_valuation_unit_price_refresh();
}
}
ಅನೂರ್ಜಿತ page_valuation_8()
{
if(valuation_unit_price
{
valuation_unit_price = valuation_unit_price * 10 + 8;
page_valuation_unit_price_refresh();
}
}
ಅನೂರ್ಜಿತ page_valuation_9()
{
if(valuation_unit_price
{
valuation_unit_price = valuation_unit_price * 10 + 9;
page_valuation_unit_price_refresh();
}
}
ಅನೂರ್ಜಿತ page_valuation_0()
{
if(valuation_unit_price
{
valuation_unit_price = valuation_unit_price * 10 + 0;
page_valuation_unit_price_refresh();
}
}
ಅನೂರ್ಜಿತ page_valuation_back()
{
valuation_unit_price = valuation_unit_price / 10;
page_valuation_unit_price_refresh();
}
ಅನೂರ್ಜಿತ page_valuation_clear()
{
valuation_unit_price = 0;
page_valuation_unit_price_refresh();
}
ಪೋಸ್ಟ್ ಸಮಯ: ಏಪ್ರಿಲ್-28-2024