关于UCGUI的程序GUIDEMO_Graph,有点不懂,跪求大神帮忙指点!!!!!!!!!! 10
staticvoid_DemoRandomGraph(void){PARAMParam;inttDiff,t0;GUI_RECTRect={19,(LCD_YSIZE-2...
static void _DemoRandomGraph(void) {
PARAM Param;
int tDiff, t0;
GUI_RECT Rect = {19, (LCD_YSIZE - 20) - YSIZE, (LCD_XSIZE - 2), (LCD_YSIZE - 21)};//不懂
GUI_HMEM hMem = GUI_ALLOC_AllocZero((LCD_XSIZE - 20) * sizeof(I16));//不懂
GUI_SetColor(GUI_WHITE);
GUI_SetBkColor(GUI_RED);
GUI_ClearRect(0, 55, LCD_XSIZE, 75);
GUI_SetFont(&GUI_FontComic18B_1);
GUI_DispStringAt("Random graph", 20, 55);
GUI_Lock();//不懂
Param.aY = GUI_ALLOC_h2p(hMem);//不懂
GUI_SetFont(&GUI_Font6x8);
t0 = GUI_GetTime();//不懂
while((tDiff = (GUI_GetTime() - t0)) < 10000) //不懂
{
int t1, tDiff2;
_GetRandomData(Param.aY, tDiff, (LCD_XSIZE - 20));//不懂
t1 = GUI_GetTime();//不懂
GUI_MEMDEV_Draw(&Rect, _Draw, &Param, 0, 0);//不懂
tDiff2 = GUI_GetTime() - t1;//不懂
if (tDiff2 < 100) {
GUI_Delay(100 - tDiff2);
}
}
GUI_Unlock();//不懂
GUI_ALLOC_Free(hMem);
}
static void _GetRandomData(I16 * paY, int Time, int n) {//不懂这个程序完全不懂,求指导
int aDiff, i;
if (Time > 5000)
Time -= 5000;
if (Time > 2500)
Time = 5000 - Time;
Time /= 200;
aDiff = Time * Time + 1;
for (i = 0; i < n; i++) {
if (!i) {
paY[i] = rand() % YSIZE;
} else {
I16 yNew;
int yD = aDiff - (rand() % aDiff);
if (rand() & 1) {
yNew = paY[i-1] + yD;
} else {
yNew = paY[i-1] - yD;
}
if (yNew > YSIZE) {
yNew -= yD;
} else { if (yNew < 0)
yNew += yD;
}
paY[i] = yNew;
}
}
}
有没有对UCGUI了解的大神啊!!!!!!!! 展开
PARAM Param;
int tDiff, t0;
GUI_RECT Rect = {19, (LCD_YSIZE - 20) - YSIZE, (LCD_XSIZE - 2), (LCD_YSIZE - 21)};//不懂
GUI_HMEM hMem = GUI_ALLOC_AllocZero((LCD_XSIZE - 20) * sizeof(I16));//不懂
GUI_SetColor(GUI_WHITE);
GUI_SetBkColor(GUI_RED);
GUI_ClearRect(0, 55, LCD_XSIZE, 75);
GUI_SetFont(&GUI_FontComic18B_1);
GUI_DispStringAt("Random graph", 20, 55);
GUI_Lock();//不懂
Param.aY = GUI_ALLOC_h2p(hMem);//不懂
GUI_SetFont(&GUI_Font6x8);
t0 = GUI_GetTime();//不懂
while((tDiff = (GUI_GetTime() - t0)) < 10000) //不懂
{
int t1, tDiff2;
_GetRandomData(Param.aY, tDiff, (LCD_XSIZE - 20));//不懂
t1 = GUI_GetTime();//不懂
GUI_MEMDEV_Draw(&Rect, _Draw, &Param, 0, 0);//不懂
tDiff2 = GUI_GetTime() - t1;//不懂
if (tDiff2 < 100) {
GUI_Delay(100 - tDiff2);
}
}
GUI_Unlock();//不懂
GUI_ALLOC_Free(hMem);
}
static void _GetRandomData(I16 * paY, int Time, int n) {//不懂这个程序完全不懂,求指导
int aDiff, i;
if (Time > 5000)
Time -= 5000;
if (Time > 2500)
Time = 5000 - Time;
Time /= 200;
aDiff = Time * Time + 1;
for (i = 0; i < n; i++) {
if (!i) {
paY[i] = rand() % YSIZE;
} else {
I16 yNew;
int yD = aDiff - (rand() % aDiff);
if (rand() & 1) {
yNew = paY[i-1] + yD;
} else {
yNew = paY[i-1] - yD;
}
if (yNew > YSIZE) {
yNew -= yD;
} else { if (yNew < 0)
yNew += yD;
}
paY[i] = yNew;
}
}
}
有没有对UCGUI了解的大神啊!!!!!!!! 展开
2个回答
展开全部
} else {
yNew = paY[i-1] - yD;
}
if (yNew > YSIZE) {
yNew -= yD;
} else { if (yNew < 0)
yNew += yD;
}
paY[i] = yNew;
}
yNew = paY[i-1] - yD;
}
if (yNew > YSIZE) {
yNew -= yD;
} else { if (yNew < 0)
yNew += yD;
}
paY[i] = yNew;
}
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
ZESTRON
2024-09-04 广告
2024-09-04 广告
在Dr. O.K. Wack Chemie GmbH,我们高度重视ZESTRON的表界面分析技术。该技术通过深入研究材料表面与界面的性质,为提升产品质量与可靠性提供了有力支持。ZESTRON的表界面分析不仅涵盖了相变化、化学反应、吸附与解吸...
点击进入详情页
本回答由ZESTRON提供
展开全部
怎么看着像嵌入式的东西啊
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询