智能车制作
标题:
线性CCD如何调出一条清晰的黑线
[打印本页]
作者:
闪闪的夜空
时间:
2016-3-5 11:04
标题:
线性CCD如何调出一条清晰的黑线
各位大神,我昨天刚把线性CCD图像调出来,现在在上位机上显示的波形是这样的,我用的是蓝宙的CCD,程序用的是蓝宙landzoK60线性CCD定曝光时间测试程序 V2.2,[attach]84147[/attach][attach]84147[/attach]
它的代码如下,******************* (C) COPYRIGHT 2011 蓝宙电子工作室 ********************
* 文件名 :main.c
* 描述 :工程模版实验
*
* 实验平台 :landzo电子开发版
* 库版本 :
* 嵌入系统 :
* CCD的PIN定义
ADC1_SE6b -- PTC10
CLK_ClrVal() PTE5_OUT = 0
SI_SetVal() PTE4_OUT = 1
* 作者 :野火嵌入式开发工作室/landzo 蓝电子
* 淘宝店 :
**********************************************************************************/
#include "include.h"
#include "calculation.h"
/*************************
设置系统的全局变量
*************************/
extern u8 TIME0flag_5ms ;
extern u8 TIME0flag_10ms ;
extern u8 TIME0flag_15ms ;
extern u8 TIME0flag_20ms ;
extern u8 TIME1flag_20ms ;
extern u8 TIME1flag_1ms ;
extern u8 TimerFlag20ms;
u8 AtemP ;
u8 Pixel[128];
void main()
{
volatile u8 i;
u8 send_data_cnt = 0;
u8 *pixel_pt;
DisableInterrupts; //禁止总中断
/*********************************************************
初始化程序
*********************************************************/
//自行添加代码
uart_init (UART0 , 115200); //初始化UART0,输出脚PTA15,输入脚PTA14,串口频率 9600
// adc_init(ADC1, AD6a) ;
gpio_init (PORTA , 17, GPO,HIGH);
gpio_init (PORTB , 17, GPO,LOW);
pit_init_ms(PIT0, 5); //初始化PIT0,定时时间为: 5ms
pit_init(PIT1, 10000); //初始化PIT1,定时时间为: 0.2ms
CCD_init1() ; //CCD传感器初始化
pixel_pt = Pixel;
for(i=0; i<128+10; i++) {
*pixel_pt++ = 0;
}
EnableInterrupts; //开总中断
/******************************************
执行程序
******************************************/
while(1)
{
if(TIME1flag_1ms == 1)
{
TIME1flag_1ms = 0 ;
// uart_putchar(UART0,0xff) ;
}
if(TIME1flag_20ms == 1)
{
TIME1flag_20ms = 0 ;
// uart_putchar(UART0,0xff) ;
/* Sampling CCD data */
ImageCapture(Pixel);
/* Send data to CCDView every 100ms */
if(++send_data_cnt >= 5) {
send_data_cnt = 0;
SendImageData(Pixel);
}
/**********
计算黑线位置
**********/
}
}
}
请问该如何调节才能显示出一条清晰的线来,需要调节哪些参数,请大神帮帮我,谢谢了
欢迎光临 智能车制作 (http://111.231.132.190/)
Powered by Discuz! X3.2