——Kuchokera ku DWIN Developer Forum
Mlandu wotsegulira wopambana mphoto womwe waperekedwa ndi gulu la DWIN ukhoza kugwiritsidwa ntchito pamakampani omanga kuti azindikire zomwe zili pa simenti - chida choyezera simenti chamitundu ingapo chotengera skrini yanzeru ya T5L. Akatswiri amagwiritsa ntchito mawonekedwe anzeru a T5L kuwongolera gawo lodziwira kulemera kwamagetsi, gawo loyezera kutentha, gawo lotenthetsera, sensa ya chinyezi, ndi gawo losanganikirana kuti azindikire ntchito yodziwira njira yolimba ndi chigawo cha simenti yamadzimadzi, ndikuthandizira kuwonetsa zenizeni zenizeni, Kuyika kwa kutentha, mbiri yakale, Kuyika magawo a Stage ndi ntchito zina.
1. Mapangidwe a Pulogalamu
![acdsb (1)](https://ecdn6.globalso.com/upload/p/1355/source/2024-03/65f96bb534d9587236.jpg)
2.UI Zinthu Zowonetsera
![acdsb (2)](https://ecdn6.globalso.com/upload/p/1355/source/2024-03/65f96bb6b626488123.jpg)
![acdsb (4)](https://ecdn6.globalso.com/upload/p/1355/source/2024-03/65f96bb84270f77694.jpg)
![acdsb (3)](https://ecdn6.globalso.com/upload/p/1355/source/2024-03/65f96bb975b6581165.jpg)
![acdb (5)](https://ecdn6.globalso.com/upload/p/1355/source/2024-03/65f96bbaf20a513069.jpg)
3.UI Development Chitsanzo
![acdb (6)](https://ecdn6.globalso.com/upload/p/1355/source/2024-03/65f96bbc7a0f429134.jpg)
4.C51 kapangidwe ka mapulogalamu
Dongosolo lolamula loyambitsa injiniya kuti alankhule ndi gulu lowongolera pogwiritsa ntchito T5L serial port 2 ndi motere:
void app_init()
{
ndi_kuyesa = 0;
test_run_time = 0;
ndi_sec = 0;
nthawi1 = 0;
ndi_period1 = 0;
uart2_init(115200);
send_bytes("AT+INIT=0\r\n",sizeof("AT+INIT=0\r\n")-1);
sys_delay_ms(2500);
sys_pic(1);
send_bytes("AT+START\r\n",sizeof("AT+START\r\n")-1);
}
Pulogalamu yayikulu ya pulogalamu yanzeru ya T5L yolumikizana ndi bolodi yowongolera kuti izindikire ntchito yodziwikiratu simenti ili motere:
void btn_click_handler()
{
# tanthauzirani BTN_VAL_ADDR 0x1000
u16 btn_val;
ngati (ndi_kuyesa&&is_sec)
{
ndi_sec = 0;
test_run_time++;
btn_val = sprintf(commbuff,"%02u:%02u",(u16)(test_run_time/60),(u16)(test_run_time%60));
commbuff[btn_val+1] = 0;
sys_write_vp(TEST_TIME_VP,commbuff,5);
ngati(uart2rxsta&UART2_PACKET_OK)
{
ngati(uart2buf[0]==0x01&&uart2buf[1]==0x02)
{
init_weight = *(float*)(uart2buf+2);
init_weight *= (*(float*)flashdat);
sys_write_vp(0x1178, (u8*)&init_weight, 2);
}mwina ngati(uart2buf[0]==0x02&&uart2buf[1]==0x05)
{
init_ml = *(float*)(uart2buf+2);
init_ml /= (*(float*)flashdat+20);
sys_write_vp(0x1180, (u8*)&init_ml, 2);
}mwina ngati(uart2buf[0]==0x03&&uart2buf[1]==0x07)
{
speed_val = *(float*)(uart2buf+2);
disp_val += (liwiro_val*2.45f);
sys_write_vp(0x1180, (u8*)&disp_val, 2);
}mwina ngati(uart2buf[0]==0x04)
{
Total_num = uart2buf[1]*256+uart2buf[2];
}mwina ngati(uart2buf[0]==0x05)
{
is_en_tmp = uart2buf[2];
}
uart2rxsta = 0;
}
}
ngati(ndi_period1)
{
ndi_period1 = 0;
t_sample ();
ngati (ndi_kuyesa&&is_en_tmp)
sys_write_vp(0x1170,(u8*)&tmp,2);
}
ngati(ndi_btn_scan==0)
kubwerera;
ndi_btn_scan = 0;
sys_read_vp(BTN_VAL_ADDR,(u8*)&btn_val,1);
ngati(btn_val==0)
kubwerera;
ngati(btn_val
start_win_btn_click_handler(btn_val);
btn_val = 0;
sys_write_vp(BTN_VAL_ADDR,(u8*)&btn_val,1);
}
Onani khodi yoyambira kuti mumve zambiri.
Nthawi yotumiza: Dec-02-2023