——Bho Fòram Luchd-leasachaidh DWIN
Anns an iris seo, bheir sinn a-steach cùis stòr fosgailte duais Fòram Luchd-leasachaidh DWIN - Siostam Deuchainn Aithneachaidh Gesture Eadar-amail. Bidh innleadairean a’ cleachdadh scrion smart COF 7-òirleach gus eadar-obrachadh leis an sensor aithneachadh gluasad-bodhaig PAJ7620U2 tro chridhe T5L OS. Chan eil feum air putanan sam bith a chleachdadh. Cha leig thu leas ach do làmh a chuir faisg air an sensor gus a dhol a-steach do scrion smachd siostam a ’chlàr, agus 9 buaidhean gluasad-bodhaig de suas, sìos, clì, deas, dlùth, fada air falbh, cuairteachadh clì, cuairteachadh deas, agus tonn a thoirt gu buil.
1.UImstuthDisplay
![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 Dealbhadh Innleadaireachd
Bidh cridhe T5L OS ag eadar-obrachadh leis an sensor aithne gluasad-bodhaig PAJ7620U2 airson eadar-obrachadh dàta, a’ lorg gluasad-bodhaig gnàthach, a’ dearbhadh an dealbh a tha air a thaisbeanadh an-dràsta agus an dealbh a tha air a thaisbeanadh le bhith a’ tionndadh na duilleige, agus a’ tuigsinn a’ ghnìomh a bhith ag atharrachadh dhuilleagan a’ cleachdadh gluasadan-bodhaig. Tha an còd iomraidh mar a leanas:
falamh tagh_operate (uint16_t gesrure_value)
{
ma tha(gesrure_value == GES_UP) // suas
{
ma tha (select_value>= 2)
{
tagh_value -= 2;
}
dgus_show_variate_icon_location_set(SELECT_DESCRIBE_RECTANGLE, tagh_pos[select_value][0], tagh_pos[select_value][1]);
}
eile ma tha(gesrure_value == GES_DOWN) // sìos
{
ma tha (select_value
{
tagh_value += 2;
}
dgus_show_variate_icon_location_set(SELECT_DESCRIBE_RECTANGLE, tagh_pos[select_value][0], tagh_pos[select_value][1]);
}
eile ma tha(gesrure_value == GES_LEFT) // air fhàgail
{
ma tha(select_value % 2 == 1)
{
tagh_value -= 1;
}
dgus_show_variate_icon_location_set(SELECT_DESCRIBE_RECTANGLE, tagh_pos[select_value][0], tagh_pos[select_value][1]);
}
eile ma tha(gesrure_value == GES_RIGHT) // deas
{
ma tha(select_value % 2 == 0)
{
tagh_value += 1;
}
dgus_show_variate_icon_location_set(SELECT_DESCRIBE_RECTANGLE, tagh_pos[select_value][0], tagh_pos[select_value][1]);
}
}
tionndadh falamh_operate (uint16_t gesrure_value)
{
uint16_t i = 0;
uint8_t Turn_mode = 0; //Modh tionndaidh duilleag, 0 suas, 1 sìos, 2 clì, 3 deas
uint16_t Turn_count = 0; //An àireamh mu dheireadh de thionndadh duilleag
if(gesrure_value == GES_UP || gesrure_value == GES_DOWN || gesrure_value == GES_LEFT || gesrure_value == GES_RIGHT)
{
ma tha(gesrure_value == GES_UP) // suas
{
tionndadh_mode = 0;
tionndadh_cunnt = 48;
}
eile ma tha(gesrure_value == GES_DOWN) // sìos
{
tionndadh_mode = 1;
tionndadh_cunnt = 48;
}
eile ma tha(gesrure_value == GES_LEFT) // air fhàgail
{
tionndadh_mode = 2;
Turn_count = 80;
}
eile ma tha(gesrure_value == GES_RIGHT) // deas
{
tionndadh_mode = 3;
Turn_count = 80;
}
ma tha (turning_current_image == 0 || turning_current_image == 2)
{
Turn_current_image = 1;
}
eile
{
Turn_current_image = 2;
}
airson(i = 0; i
{
suidse (modh_tionndaidh)
{
cùis 0:
dgus_show_variate_icon_location_set (turning_current_image * 0x100 + 0x2000, 0, 480 - i * 10);
t5l0_sys_delay_ms(20);
ma tha (turning_last_image!= 0)
{
dgus_show_variate_icon_location_set (turning_last_image * 0x100 + 0x2000, 0, 0 - i * 10);
}
briseadh;
cùis 1:
dgus_show_variate_icon_location_set (turning_current_image * 0x100 + 0x2000, 0, -480 + i * 10);
t5l0_sys_delay_ms(20);
ma tha (turning_last_image!= 0)
{
dgus_show_variate_icon_location_set (turning_last_image * 0x100 + 0x2000, 0, 0 + i * 10);
}
briseadh;
cùis 2:
dgus_show_variate_icon_location_set (turning_current_image * 0x100 + 0x2000, 800 - i * 10, 0);
t5l0_sys_delay_ms(20);
ma tha (turning_last_image!= 0)
{
dgus_show_variate_icon_location_set (turning_last_image * 0x100 + 0x2000, 0 - i * 10, 0);
}
briseadh;
cùis 3:
dgus_show_variate_icon_location_set (turning_current_image * 0x100 + 0x2000, -800 + i * 10, 0);
t5l0_sys_delay_ms(20);
ma tha (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;
}
}
Ùine puist: Mar-21-2024