lcdmenu.h

来自「基于凌阳和ad9850实现的正弦波信号发生器程序」· C头文件 代码 · 共 39 行

H
39
字号
#ifndef	__LCDMENU_H__
#define	__LCDMENU_H__
//	write your header here
/*int Am=20000;
int Sin(int t)
{
	int t2=t*t;										//t的平方;
	int res;
	res=t*(60-t2*(10-t2/2));
	//(1-t2/6*(1-t2/20*(1-t2/42*(1-t2/72))));		//这里把级数变化成这个样子是为了减少运算的次数,此法成为霍诺法;
	return res;
}


//虽然函数名为余弦,但里面不只是余弦,余弦后还算了k的值;
int Cos(double t)
{
	double t2=t*t;
	double res;
	res=1-t2/2*(1-t2/12*(1-t2/30*(1-t2/56)));
	res=res*32768;
	res+=0.5;
	res=(int)res;
	return res;
}

	while(1)
	{
		Watchdog_Clear=1;
		xx+=0.8;
		yy=(int)((sinf(xx/8))*16+0.5+32);//yy++;
		if(xx<128)
			LCD501_PutPixel((int)xx,(int)(yy));

		if(xx>128)
			break;
	}*/
#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?