智能车制作
标题:
ccd
[打印本页]
作者:
1039074784
时间:
2013-1-11 20:21
标题:
ccd
void StartIntegration(void) {
unsigned char i;
SI_SetVal(); /* SI = 1 */
SamplingDelay();
CLK_SetVal(); /* CLK = 1 */
SamplingDelay();
SI_ClrVal(); /* SI = 0 */
SamplingDelay();
CLK_ClrVal(); /* CLK = 0 */
for(i=0; i<127; i++) {
SamplingDelay();
SamplingDelay();
CLK_SetVal(); /* CLK = 1 */
SamplingDelay();
SamplingDelay();
CLK_ClrVal(); /* CLK = 0 */
}
SamplingDelay();
SamplingDelay();
CLK_SetVal(); /* CLK = 1 */
SamplingDelay();
SamplingDelay();
CLK_ClrVal(); /* CLK = 0 */
}
void ImageCapture(unsigned char * ImageData) {
unsigned char i;
unsigned char error;
unsigned int temp_int;
SI_SetVal(); /* SI = 1 */
SamplingDelay();
CLK_SetVal(); /* CLK = 1 */
SamplingDelay();
SI_ClrVal(); /* SI = 0 */
SamplingDelay();
//Delay 10us for sample the first pixel
for(i = 0; i < 10; i++) {
Cpu_Delay1us();
}
//Sampling Pixel 1
error = AO_Measure(TRUE);
error = AO_GetValue16(&temp_int);
*ImageData++ = (byte)(temp_int>>8);
CLK_ClrVal(); /* CLK = 0 */
for(i=0; i<127; i++) {
SamplingDelay();
SamplingDelay();
CLK_SetVal(); /* CLK = 1 */
SamplingDelay();
SamplingDelay();
//Sampling Pixel 2~128
error = AO_Measure(TRUE);
error = AO_GetValue16(&temp_int);
*ImageData++ = (byte)(temp_int>>8);
CLK_ClrVal(); /* CLK = 0 */
}
SamplingDelay();
SamplingDelay();
CLK_SetVal(); /* CLK = 1 */
SamplingDelay();
SamplingDelay();
CLK_ClrVal(); /* CLK = 0 */
}
void SendHex(unsigned char hex) {
unsigned char temp;
temp = hex >> 4;
if(temp < 10) {
SendChar_Polling(temp + '0');
} else {
SendChar_Polling(temp - 10 + 'A');
}
temp = hex & 0x0F;
if(temp < 10) {
SendChar_Polling(temp + '0');
} else {
SendChar_Polling(temp - 10 + 'A');
}
}
这程序怎么解释?求解!!!
作者:
Mr_Q
时间:
2013-1-11 20:32
红烧肉~
作者:
风暴
时间:
2013-1-11 20:33
/*************************************************
曝光开始
*************************************************/
void StartIntegration(void) {
unsigned char i;
SI_SetVal(); // SI = 1
SamplingDelay();
CLK_SetVal(); // CLK = 1
SamplingDelay();
SI_ClrVal(); // SI = 0
SamplingDelay();
CLK_ClrVal(); // CLK = 0
for(i=0; i<127; i++) {
SamplingDelay();
SamplingDelay();
CLK_SetVal(); // CLK = 1
SamplingDelay();
SamplingDelay();
CLK_ClrVal(); // CLK = 0
}
SamplingDelay();
SamplingDelay();
CLK_SetVal(); // CLK = 1
SamplingDelay();
SamplingDelay();
CLK_ClrVal(); // CLK = 0
}
/*************************************************
CCD采样程序
*************************************************/
void ImageCapture(unsigned char * ImageData) {
unsigned char i;
unsigned char error;
unsigned int temp_int;
SI_SetVal(); /* SI = 1 */
SamplingDelay();
CLK_SetVal(); /* CLK = 1 */
SamplingDelay();
SI_ClrVal(); /* SI = 0 */
SamplingDelay();
//Delay 10us for sample the first pixel
for(i = 0; i < 10; i++) {
Cpu_Delay1us();
}
//Sampling Pixel 1
error = AO_Measure(TRUE);
error = AO_GetValue16(&temp_int);
*ImageData++ = (byte)(temp_int>>8);
CLK_ClrVal(); /* CLK = 0 */
for(i=0; i<127; i++) {
SamplingDelay();
SamplingDelay();
CLK_SetVal(); /* CLK = 1 */
SamplingDelay();
SamplingDelay();
//Sampling Pixel 2~128
error = AO_Measure(TRUE);
error = AO_GetValue16(&temp_int);
*ImageData++ = (byte)(temp_int>>8);
CLK_ClrVal(); /* CLK = 0 */
}
SamplingDelay();
SamplingDelay();
CLK_SetVal(); /* CLK = 1 */
SamplingDelay();
SamplingDelay();
CLK_ClrVal(); /* CLK = 0 */
}
/**************** 转换成16进制发送 ************************/
void SendHex(unsigned char hex) {
unsigned char temp;
temp = hex >> 4;
if(temp < 10) {
SendChar_Polling(temp + '0');
} else {
SendChar_Polling(temp - 10 + 'A');
}
temp = hex & 0x0F;
if(temp < 10) {
SendChar_Polling(temp + '0');
} else {
SendChar_Polling(temp - 10 + 'A');
}
}
作者:
风暴
时间:
2013-1-11 20:34
http://www.znczz.com/thread-112129-1-1.html
我也才开始看CCD,可以看看这个视屏,有讲解
作者:
1039074784
时间:
2013-1-11 20:50
这个只讲了一部分,其他部分没说呢!!!
作者:
1039074784
时间:
2013-1-11 20:55
整体框架意思知道,但不知道为什么这么写?
作者:
1006110218
时间:
2013-1-11 20:58
实际曝光就是进行积分!
作者:
Peaker
时间:
2013-1-11 21:11
作者:
zhangjunzhe
时间:
2013-1-24 16:56
转换16进制那个函数为什么我单独用用不了
欢迎光临 智能车制作 (http://dns.znczz.com/)
Powered by Discuz! X3.2