📄 main.c
字号:
//利用4Hz时基中断,
#include<spce061a_chf.h>
#include"bit.h"
#include"TCS230.h"
int main(void)
{
unsigned int t_red=0;
unsigned int t_green=0;
unsigned int t_blue=0;//白平衡测试得到的时间值
unsigned int temp_counter=0;
unsigned int counter_red=0;
unsigned int counter_green=0;
unsigned int counter_blue=0;//实际测试得到的颜色值
*P_INT_Ctrl=0x0008;
asm("irq off");
init_IO();
while(1)
{
temp_counter=Red();
t_red=0.25*255/temp_counter;
temp_counter=Blue();
t_blue=0.25*255/temp_counter;
temp_counter=Green();
t_green=0.25*255/temp_counter;//白平衡测试
//下面开始实际测试
temp_counter=Red();
counter_red=t_red*temp_counter/0.25;
temp_counter=Blue();
counter_blue=t_blue*temp_counter/0.25;
temp_counter=Green();
counter_green=t_green*temp_counter/0.25;//实际测试
//下面根据counter_red,counter_blue,counter_green分析颜色值
}
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -