——Gan Fforwm Datblygwyr DWIN
Yn y rhifyn hwn, byddwn yn cyflwyno achos ffynhonnell agored arobryn Fforwm Datblygwyr DWIN - System Prawf Adnabod Ystum Cyfwng. Mae peirianwyr yn defnyddio sgrin smart COF 7-modfedd i ryngweithio â synhwyrydd adnabod ystum PAJ7620U2 trwy graidd T5L OS. Nid oes angen defnyddio unrhyw fotymau. Dim ond angen i chi roi eich llaw yn agos at y synhwyrydd i fynd i mewn i'r sgrin rheoli system fwydlen, a gwireddu 9 ystum effeithiau i fyny, i lawr, i'r chwith, i'r dde, yn agos, ymhell i ffwrdd, cylchdro chwith, cylchdro dde, a ton.
1.UIMdeunyddDisplay
![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 Dylunio Peirianyddol
Mae craidd T5L OS yn rhyngweithio â synhwyrydd adnabod ystum PAJ7620U2 ar gyfer rhyngweithio data, yn canfod yr ystum cyfredol, yn pennu'r llun a ddangosir ar hyn o bryd a'r llun a ddangosir trwy droi'r dudalen, ac yn gwireddu swyddogaeth newid tudalennau gan ddefnyddio ystumiau. Mae'r cod cyfeirio fel a ganlyn:
gwag select_operate(uint16_t gesrure_value)
{
os(gesrure_value == GES_UP) // i fyny
{
os (dewiswch_werth >= 2)
{
select_value -= 2;
}
dgus_show_variate_icon_location_set(SELECT_DESCRIBE_RECTANGLE, dewiswch_pos[select_value][0], dewiswch_pos[select_value][1]);
}
arall os(gesrure_value == GES_DOWN) //down
{
os(select_value
{
select_value += 2;
}
dgus_show_variate_icon_location_set(SELECT_DESCRIBE_RECTANGLE, dewiswch_pos[select_value][0], dewiswch_pos[select_value][1]);
}
arall os(gesrure_value == GES_LEFT) // chwith
{
if(select_value % 2 == 1)
{
select_value -= 1;
}
dgus_show_variate_icon_location_set(SELECT_DESCRIBE_RECTANGLE, dewiswch_pos[select_value][0], dewiswch_pos[select_value][1]);
}
arall os(gesrure_value == GES_RIGHT) //iawn
{
if(select_value % 2 == 0)
{
select_value += 1;
}
dgus_show_variate_icon_location_set(SELECT_DESCRIBE_RECTANGLE, dewiswch_pos[select_value][0], dewiswch_pos[select_value][1]);
}
}
gweithredu_troi gwag(uint16_t gesrure_value)
{
uint16_t i = 0;
uint8_t Turn_mode = 0; //Modd troi tudalen, 0 i fyny, 1 i lawr, 2 i'r chwith, 3 i'r dde
uint16_t Turn_count = 0; //Nifer olaf y troadau tudalen
if(gesrure_value == GES_UP || gesrure_value == GES_DOWN || gesrure_value == GES_LEFT || gesrure_value == GES_RIGHT )
{
os(gesrure_value == GES_UP) // i fyny
{
Turn_mode = 0;
Turn_count = 48;
}
arall os(gesrure_value == GES_DOWN) //down
{
Turn_mode = 1;
Turn_count = 48;
}
arall os(gesrure_value == GES_LEFT) // chwith
{
Turn_mode = 2;
Turn_count = 80;
}
arall os(gesrure_value == GES_RIGHT) //iawn
{
Turn_mode = 3;
Turn_count = 80;
}
os(turning_current_image == 0 || Turning_current_image == 2)
{
Turn_current_image = 1;
}
arall
{
Turn_current_image = 2;
}
ar gyfer(i = 0; i
{
switsh (modd_troi)
{
achos 0:
dgus_show_variate_icon_location_set(turning_current_image * 0x100 + 0x2000, 0, 480 - i * 10);
t5l0_sys_delay_ms(20);
os(turning_last_image!= 0)
{
dgus_show_variate_icon_location_set(turning_last_image * 0x100 + 0x2000, 0, 0 - i * 10);
}
torri;
achos 1:
dgus_show_variate_icon_location_set(turning_current_image * 0x100 + 0x2000, 0, -480 + i * 10);
t5l0_sys_delay_ms(20);
os(turning_last_image!= 0)
{
dgus_show_variate_icon_location_set(turning_last_image * 0x100 + 0x2000, 0, 0 + i * 10);
}
torri;
achos 2:
dgus_show_variate_icon_location_set(turning_current_image * 0x100 + 0x2000, 800 - i * 10, 0);
t5l0_sys_delay_ms(20);
os(turning_last_image!= 0)
{
dgus_show_variate_icon_location_set(turning_last_image * 0x100 + 0x2000, 0 - i * 10, 0);
}
torri;
achos 3:
dgus_show_variate_icon_location_set(turning_current_image * 0x100 + 0x2000, -800 + i * 10, 0);
t5l0_sys_delay_ms(20);
os(turning_last_image!= 0)
{
dgus_show_variate_icon_location_set(turning_last_image * 0x100 + 0x2000, 0 + i * 10, 0);
}
torri;
}
t5l0_sys_delay_ms(20);
}
Turn_last_image = Turn_current_image;
}
}
Amser post: Maw-21-2024