[Malferma Fonto] Intervala Gestura Rekono Testy System

——El Forumo por Programistoj de DWIN

En ĉi tiu numero, ni enkondukos la premiitan malfermfontan kazon de la Forumo por Programistoj DWIN - Interval Gesture Recognition Test System. Inĝenieroj uzas 7-colan COF inteligentan ekranon por interagi kun la PAJ7620U2 gestrekona sensilo per la T5L OS-kerno. Ne necesas uzi ajnajn butonojn. Vi nur bezonas meti vian manon proksime al la sensilo por eniri la menuan sistemon kontrolekranon, kaj realigi 9 gestajn efikojn de supren, malsupren, maldekstre, dekstre, proksime, malproksime, maldekstra rotacio, dekstra rotacio kaj ondo.

1.UIMmaterialoDisplay

asd (2)
asd (1)

2.C51 Inĝenieristiko-Dezajno

La T5L OS-kerno interagas kun la PAJ7620U2 gesta rekona sensilo por interago de datumoj, detektas la aktualan geston, determinas la nuntempe montritan bildon kaj la bildon montritan turnante la paĝon, kaj realigas la funkcion ŝanĝi paĝojn per gestoj. La referenca kodo estas jena:

void select_operate (uint16_t gesture_value)

{

if(gesrura_valoro == GES_UP) //supren

{

if(elektu_valoro >= 2)

{

elekt_valoro -= 2;

}

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

}

else if(gesruro_valoro == GES_DOWN) //malsupren

{

se (elekto_valoro

{

elekt_valoro += 2;

}

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

}

else if(gesruro_valoro == GES_LEFT) //maldekstre

{

if(elekto_valoro % 2 == 1)

{

elekt_valoro -= 1;

}

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

}

else if(gesruro_valoro == GES_RIGHT) //dekstre

{

if(elekto_valoro % 2 == 0)

{

elekt_valoro += 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 gesture_value)

{

uint16_t i = 0;

uint8_t turning_mode = 0; //Reĝimo de turniĝo de paĝo, 0 supren, 1 malsupren, 2 maldekstre, 3 dekstre

uint16_t turning_count = 0; //Lasta nombro da paĝturnoj

if(gesra_valoro == GES_UP || gesture_valoro == GES_DOWN || gesture_valoro == GES_LEFT || gesture_valoro == GES_RIGHT)

{

if(gesrura_valoro == GES_UP) //supren

{

turniĝanta_reĝimo = 0;

turniĝanta_kalkulo = 48;

}

else if(gesruro_valoro == GES_DOWN) //malsupren

{

turniĝanta_reĝimo = 1;

turniĝanta_kalkulo = 48;

}

else if(gesruro_valoro == GES_LEFT) //maldekstre

{

turniĝanta_reĝimo = 2;

turniĝanta_kalkulo = 80;

}

else if(gesruro_valoro == GES_RIGHT) //dekstre

{

turniĝanta_reĝimo = 3;

turniĝanta_kalkulo = 80;

}

if(turniĝanta_nuna_bildo == 0 || turniĝanta_nuna_bildo == 2)

{

turniĝanta_nuna_bildo = 1;

}

alie

{

turniĝanta_nuna_bildo = 2;

}

por(i = 0;i

{

ŝaltilo (turniĝanta_reĝimo)

{

kazo 0:

dgus_show_variate_icon_location_set (turniĝanta_nuna_bildo * 0x100 + 0x2000, 0, 480 - i * 10);

t5l0_sys_delay_ms(20);

if(turnante_lasta_bildon != 0)

{

dgus_show_variate_icon_location_set (turniĝanta_lasta_bildo * 0x100 + 0x2000, 0, 0 - i * 10);

}

rompi;

kazo 1:

dgus_show_variate_icon_location_set (turniĝanta_nuna_bildo * 0x100 + 0x2000, 0, -480 + i * 10);

t5l0_sys_delay_ms(20);

if(turnante_lasta_bildon != 0)

{

dgus_show_variate_icon_location_set (turniĝanta_lasta_bildo * 0x100 + 0x2000, 0, 0 + i * 10);

}

rompi;

kazo 2:

dgus_show_variate_icon_location_set (turniĝanta_nuna_bildo * 0x100 + 0x2000, 800 - i * 10, 0);

t5l0_sys_delay_ms(20);

if(turnante_lasta_bildon != 0)

{

dgus_show_variate_icon_location_set (turniĝanta_lasta_bildo * 0x100 + 0x2000, 0 - i * 10, 0);

}

rompi;

kazo 3:

dgus_show_variate_icon_location_set (turniĝanta_nuna_bildo * 0x100 + 0x2000, -800 + i * 10, 0);

t5l0_sys_delay_ms(20);

if(turnante_lasta_bildon != 0)

{

dgus_show_variate_icon_location_set (turniĝanta_lasta_bildo * 0x100 + 0x2000, 0 + i * 10, 0);

}

rompi;

}

t5l0_sys_delay_ms(20);

}

turning_last_image = turniĝanta_nuna_bildo;

}

}


Afiŝtempo: Mar-21-2024