main.c

来自「博创2410的实验代码」· C语言 代码 · 共 31 行

C
31
字号
#include "../inc/drivers.h"
#include "../inc/lib.h"
#include <string.h>
#include <stdio.h>
#include "inc/max504.h"
#include <stdio.h>
#include <math.h>
#include "inc/Exio.h"
#pragma import(__use_no_semihosting_swi)  // ensure no functions that use semihosting 
void  ARMTargetInit(void); 
int main(void)
{   	
	int flag=0;
	double i,y;
	ARMTargetInit();	//开发版初始化
	MAX504_CLEAR();
	while(1)
	{
		for(i=0;i<6.28;i=i+0.1){
		 	y=sin(i);                  //获取Y轴幅值
			Uart_Printf(0,"\ny=%f",y);
			Max504_SetDA((y+1)*500);   //设置DA输出
			hudelay(10);
		}
	}
	return 0;	
}
	
	

⌨️ 快捷键说明

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