[오픈소스] 간격 제스처 인식 테스트 시스템

——DWIN 개발자 포럼에서

이번 호에서는 수상 경력이 있는 DWIN 개발자 포럼 – 간격 제스처 인식 테스트 시스템의 오픈 소스 사례를 소개합니다. 엔지니어는 7인치 COF 스마트 화면을 사용하여 T5L OS 코어를 통해 PAJ7620U2 동작 인식 센서와 상호 작용합니다. 버튼을 사용할 필요가 없습니다. 메뉴 시스템 제어 화면에 들어가려면 센서에 손을 가까이 대기만 하면 되며, 위, 아래, 왼쪽, 오른쪽, 가까이, 멀리, 왼쪽 회전, 오른쪽 회전 및 물결의 9가지 제스처 효과를 실현할 수 있습니다.

1.UI재료디스플레이

asd (2)
asd (1)

2.C51 공학설계

T5L OS 코어는 데이터 상호 작용을 위해 PAJ7620U2 제스처 인식 센서와 상호 작용하고, 현재 제스처를 감지하고, 현재 표시된 사진과 페이지를 넘겨 표시되는 사진을 결정하고, 제스처를 사용하여 페이지 전환 기능을 실현합니다. 참조 코드는 다음과 같습니다.

무효 select_operate(uint16_t gesrure_value)

{

if(gesrure_value == GES_UP) //위

{

if(select_value >= 2)

{

select_value -= 2;

}

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

}

else if(gesrure_value == GES_DOWN) //다운

{

if(select_value

{

select_value += 2;

}

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

}

else if(gesrure_value == GES_LEFT) //왼쪽

{

if(select_value % 2 == 1)

{

select_value -= 1;

}

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

}

else if(gesrure_value == GES_RIGHT) //오른쪽

{

if(select_value % 2 == 0)

{

select_value += 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 Turning_mode = 0; //페이지 넘김 모드, 위쪽 0개, 아래쪽 1개, 왼쪽 2개, 오른쪽 3개

uint16_t Turning_count = 0; //마지막 페이지 넘김 횟수

if(gesrure_value == GES_UP || gesrure_value == GES_DOWN || gesrure_value == GES_LEFT || gesrure_value == GES_RIGHT)

{

if(gesrure_value == GES_UP) //위

{

터닝_모드 = 0;

터닝카운트 = 48;

}

else if(gesrure_value == GES_DOWN) //다운

{

터닝_모드 = 1;

터닝카운트 = 48;

}

else if(gesrure_value == GES_LEFT) //왼쪽

{

터닝_모드 = 2;

터닝카운트 = 80;

}

else if(gesrure_value == GES_RIGHT) //오른쪽

{

터닝_모드 = 3;

터닝카운트 = 80;

}

if(turning_current_image == 0 || Turning_current_image == 2)

{

Turning_current_image = 1;

}

또 다른

{

Turning_current_image = 2;

}

for(i = 0;i

{

스위치(turning_mode)

{

사례 0:

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

t5l0_sys_delay_ms(20);

if(turning_last_image != 0)

{

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

}

부서지다;

사례 1:

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

t5l0_sys_delay_ms(20);

if(turning_last_image != 0)

{

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

}

부서지다;

사례 2:

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

t5l0_sys_delay_ms(20);

if(turning_last_image != 0)

{

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

}

부서지다;

사례 3:

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

t5l0_sys_delay_ms(20);

if(turning_last_image != 0)

{

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

}

부서지다;

}

t5l0_sys_delay_ms(20);

}

Turning_last_image=turning_current_image;

}

}


게시 시간: 2024년 3월 21일