——Ó Fhóram Forbróirí DWIN
San eagrán seo, tabharfaimid isteach cás foinse oscailte a bhfuil duaiseanna buaite aige d’Fhóram Forbróirí DWIN - Córas Tástála Aithint Gheotaí Eatramhacha. Úsáideann innealtóirí scáileán cliste COF 7-orlach chun idirghníomhú le braiteoir aitheantais gothaí PAJ7620U2 trí chroílár T5L OS. Ní gá aon cnaipí a úsáid. Ní mór duit ach do lámh a chur in aice leis an braiteoir chun dul isteach ar scáileán rialaithe an chórais roghchláir, agus 9 éifeacht gesture de suas, síos, clé, ar dheis, gar, i bhfad ar shiúl, rothlú clé, rothlú ceart, agus tonn a bhaint amach.
1.UIMábharDisplay
![asd (2)](https://ecdn6.globalso.com/upload/p/1355/source/2024-06/665f07846d9de96799.png)
![asd (1)](https://ecdn6.globalso.com/upload/p/1355/source/2024-06/665f07860ad7d49985.png)
2.C51 Dearadh Innealtóireachta
Idirghníomhaíonn croí T5L OS le braiteoir aitheantais gothaí PAJ7620U2 le haghaidh idirghníomhaíocht sonraí, aimsíonn sé an gotha reatha, socraíonn sé an pictiúr atá ar taispeáint faoi láthair agus an pictiúr a thaispeánann tríd an leathanach a chasadh, agus tuigeann sé an fheidhm atá le leathanaigh a athrú ag baint úsáide as gothaí. Is é seo a leanas an cód tagartha:
neamhní roghnaigh_operate(uint16_t gesrure_value)
{
más rud é(gesrure_value == GES_UP) // suas
{
má (roghnaigh_luach>= 2)
{
roghnaigh_value -= 2;
}
dgus_show_variate_icon_location_set(SELECT_DESCRIBE_RECTANGLE, roghnaigh_pos[select_value][0], roghnaigh_pos[select_value][1]);
}
eile más rud é(gesrure_value == GES_DOWN) // síos
{
má(roghnaigh_luach
{
roghnaigh_value += 2;
}
dgus_show_variate_icon_location_set(SELECT_DESCRIBE_RECTANGLE, roghnaigh_pos[select_value][0], roghnaigh_pos[select_value][1]);
}
eile má tá(gesrure_value == GES_LEFT) // fágtha
{
if(select_value % 2 == 1)
{
roghnaigh_value -= 1;
}
dgus_show_variate_icon_location_set(SELECT_DESCRIBE_RECTANGLE, roghnaigh_pos[select_value][0], roghnaigh_pos[select_value][1]);
}
eile más rud é(gesrure_value == GES_RIGHT) // ar dheis
{
if(select_value % 2 == 0)
{
roghnaigh_value += 1;
}
dgus_show_variate_icon_location_set(SELECT_DESCRIBE_RECTANGLE, roghnaigh_pos[select_value][0], roghnaigh_pos[select_value][1]);
}
}
ar neamhní ag casadh_oibriú (uint16_t gesrure_value)
{
uint16_t i = 0;
uint8_t casadh_mode = 0; //Modh casadh leathanaigh, 0 suas, 1 síos, 2 ar chlé, 3 ar dheis
uint16_t casadh_count = 0; //An líon deiridh de casadh leathanaigh
if(gesrure_value == GES_UP || gesrure_value == GES_DOWN || gesrure_value == GES_LEFT || gesrure_value == GES_RIGHT)
{
más rud é(gesrure_value == GES_UP) // suas
{
casadh_mode = 0;
casadh_count = 48;
}
eile más rud é(gesrure_value == GES_DOWN) // síos
{
casadh_mode = 1;
casadh_count = 48;
}
eile má tá(gesrure_value == GES_LEFT) // fágtha
{
casadh_mode = 2;
casadh_count = 80;
}
eile más rud é(gesrure_value == GES_RIGHT) // ar dheis
{
casadh_mode = 3;
casadh_count = 80;
}
má(turning_current_image == 0 || Turning_current_image == 2)
{
casadh_current_image = 1;
}
eile
{
casadh_current_image = 2;
}
le haghaidh(i = 0; i
{
lasc (mód_casadh)
{
cás 0:
dgus_show_variate_icon_location_set(turning_current_image * 0x100 + 0x2000, 0, 480 - i * 10);
t5l0_sys_delay_ms(20);
má(turning_last_image!= 0)
{
dgus_show_variate_icon_location_set(turning_last_image * 0x100 + 0x2000, 0, 0 - i * 10);
}
briseadh ;
cás 1:
dgus_show_variate_icon_location_set(turning_current_image * 0x100 + 0x2000, 0, -480 + i * 10);
t5l0_sys_delay_ms(20);
má(turning_last_image!= 0)
{
dgus_show_variate_icon_location_set(turning_last_image * 0x100 + 0x2000, 0, 0 + i * 10);
}
briseadh ;
cás 2:
dgus_show_variate_icon_location_set(turning_current_image * 0x100 + 0x2000, 800 - i * 10, 0);
t5l0_sys_delay_ms(20);
má(turning_last_image!= 0)
{
dgus_show_variate_icon_location_set(turning_last_image * 0x100 + 0x2000, 0 - i * 10, 0);
}
briseadh ;
cás 3:
dgus_show_variate_icon_location_set(turning_current_image * 0x100 + 0x2000, -800 + i * 10, 0);
t5l0_sys_delay_ms(20);
má(turning_last_image!= 0)
{
dgus_show_variate_icon_location_set(turning_last_image * 0x100 + 0x2000, 0 + i * 10, 0);
}
briseadh ;
}
t5l0_sys_delay_ms(20);
}
Turn_last_image = Turn_current_image;
}
}
Am poist: Mar-21-2024