大虾们进来看看
时间:10-02
整理:3721RD
点击:
这个程序为啥当count为0x3c-0x4e时,sin_data的数值会与手工计算的值不一样,不知程序错在哪,帮我一下!先谢了
#include "reg51.h"
#include "intrins.h"
#include "math.h"
#define PI 3.1415926
#define uchar unsigned char
#define uint unsigned int
uint count;
short sin_data;
void main()
{
mcu_init();
for(count=1;count<270;count++)
{
sin_data=126*(sin(2*PI*count/270))+128;
}
while(1);
}
#include "reg51.h"
#include "intrins.h"
#include "math.h"
#define PI 3.1415926
#define uchar unsigned char
#define uint unsigned int
uint count;
short sin_data;
void main()
{
mcu_init();
for(count=1;count<270;count++)
{
sin_data=126*(sin(2*PI*count/270))+128;
}
while(1);
}