[Burimi i hapur] Sistemi i testimit të njohjes së gjestit interval

——Nga Forumi i Zhvilluesve DWIN

Në këtë numër, ne do të prezantojmë rastin me burim të hapur fitues të çmimeve të Forumit të Zhvilluesve DWIN – Sistemi i Testit të Njohjes së Gjesteve Interval. Inxhinierët përdorin një ekran inteligjent COF 7 inç për të bashkëvepruar me sensorin e njohjes së gjesteve PAJ7620U2 përmes bërthamës së sistemit operativ T5L. Nuk ka nevojë të përdorni asnjë buton. Mjafton të vendosni dorën pranë sensorit për të hyrë në ekranin e kontrollit të sistemit të menusë dhe për të realizuar 9 efekte gjestesh si lart, poshtë, majtas, djathtas, afër, larg, rrotullimi majtas, rrotullimi djathtas dhe valëzimi.

1.UIMmaterialDisplay

asd (2)
asd (1)

2.C51 Projektimi inxhinierik

Bërthama e sistemit operativ T5L ndërvepron me sensorin e njohjes së gjesteve PAJ7620U2 për ndërveprimin e të dhënave, zbulon gjestin aktual, përcakton figurën e shfaqur aktualisht dhe figurën e shfaqur duke kthyer faqen dhe realizon funksionin e ndërrimit të faqeve duke përdorur gjeste. Kodi i referencës është si më poshtë:

void select_operate(uint16_t gesrure_value)

{

if(gesrure_value == GES_UP) //lart

{

nëse (përzgjidhni_vlerën >= 2)

{

zgjedh_vlera -= 2;

}

dgus_show_variate_icon_location_set (SELECT_DESCRIBE_RECTANGLE, select_pos[select_value][0], select_pos[select_value][1]);

}

ndryshe if(gesrure_value == GES_DOWN) //down

{

nëse (zgjidhni_vlerën

{

zgjedh_vlera += 2;

}

dgus_show_variate_icon_location_set (SELECT_DESCRIBE_RECTANGLE, select_pos[select_value][0], select_pos[select_value][1]);

}

ndryshe if(gesrure_value == GES_LEFT) //left

{

nëse (zgjidhni_vlerën % 2 == 1)

{

zgjedh_vlera -= 1;

}

dgus_show_variate_icon_location_set (SELECT_DESCRIBE_RECTANGLE, select_pos[select_value][0], select_pos[select_value][1]);

}

ndryshe if(gesrure_value == GES_RIGHT) //djathtas

{

nëse (zgjidhni_vlerën % 2 == 0)

{

zgjedh_vlera += 1;

}

dgus_show_variate_icon_location_set (SELECT_DESCRIBE_RECTANGLE, select_pos[select_value][0], select_pos[select_value][1]);

}

}

 

void turning_operate(uint16_t gesrure_value)

{

uint16_t i = 0;

uint8_t modaliteti i_kthimit = 0; //Modaliteti i rrotullimit të faqes, 0 lart, 1 poshtë, 2 majtas, 3 djathtas

uint16_t numërimi i_kthimit = 0; //Numri i fundit i kthesave të faqeve

nëse (vlera_gesrure == GES_UP || gesrure_value == GES_POSHT || gesrure_value == GES_LEFT || gesrure_value == GES_Djathtas)

{

if(gesrure_value == GES_UP) //lart

{

modaliteti i kthimit = 0;

numërimi i kthesës = 48;

}

ndryshe if(gesrure_value == GES_DOWN) //down

{

modaliteti i kthesës = 1;

numërimi i kthesës = 48;

}

ndryshe if(gesrure_value == GES_LEFT) //left

{

modaliteti i kthimit = 2;

numërimi i kthesës = 80;

}

ndryshe if(gesrure_value == GES_RIGHT) //djathtas

{

modaliteti i kthimit = 3;

numërimi i kthesës = 80;

}

nëse (imazhi_aktual_kthyes == 0 || imazhi_aktual_kthyes == 2)

{

kthesë_imazhi_rrymë = 1;

}

tjetër

{

imazhi_aktual_kthyes = 2;

}

për(i = 0;i

{

ndërprerësi (modaliteti i_kthimit)

{

rasti 0:

dgus_show_variate_icon_location_set(turning_current_image * 0x100 + 0x2000, 0, 480 - i * 10);

t5l0_sys_delay_ms(20);

if (kthimi_imazhi_e fundit != 0)

{

dgus_show_variate_icon_location_set (turning_last_image * 0x100 + 0x2000, 0, 0 - i * 10);

}

pushim;

rasti 1:

dgus_show_variate_icon_location_set (turning_current_image * 0x100 + 0x2000, 0, -480 + i * 10);

t5l0_sys_delay_ms(20);

nëse (imazhi_i_fundit_kthyes != 0)

{

dgus_show_variate_icon_location_set (turning_last_image * 0x100 + 0x2000, 0, 0 + i * 10);

}

pushim;

rasti 2:

dgus_show_variate_icon_location_set(turning_current_image * 0x100 + 0x2000, 800 - i * 10, 0);

t5l0_sys_delay_ms(20);

if (kthimi_imazhi_e fundit != 0)

{

dgus_show_variate_icon_location_set (turning_last_image * 0x100 + 0x2000, 0 - i * 10, 0);

}

pushim;

rasti 3:

dgus_show_variate_icon_location_set(turning_current_image * 0x100 + 0x2000, -800 + i * 10, 0);

t5l0_sys_delay_ms(20);

if (kthimi_imazhi_e fundit != 0)

{

dgus_show_variate_icon_location_set (turning_last_image * 0x100 + 0x2000, 0 + i * 10, 0);

}

pushim;

}

t5l0_sys_delay_ms(20);

}

kthesë_imazhi_i fundit = kthesë_imazhi_aktual;

}

}


Koha e postimit: Mar-21-2024