各位大神,如何通过wifi模块 esp8266上传 OV7670的照片呢,已经试了多次,请大家给与指教,我把自己该的程序贴上
printf("while 马上运行");
while(1)
{
key=KEY_Scan(0);
status = RFID_Init(SN);
// camera_init();
//printf("ID:%02x %02x %02x %02x\n",SN[0],SN[1],SN[2],SN[3]);
printf("rfid运行");
if(key==WKUP_PRES) //WK_UP 退出测试
{
res=0;
atk_8266_quit_trans(); //退出透传
atk_8266_send_cmd("AT+CIPMODE=0","OK",20); //关闭透传模式
break;
}
else if(status==MI_OK) //KEY0 发送数据 key==KEY1_PRES
{
sprintf((char*)p,"ID: %0x%0x%0x%0x" ,SN[0],SN[1],SN[2],SN[3]);//测试数据 sprintf((char*)p,"ATK-8266%s测试%02d\r\n",ATK_ESP8266_WORKMODE_TBL[netpro],t/10); //
ShowID(0,200,p,BLUE ,WHITE);
Show_Str(30+54,100,200,12,p,12,0);
atk_8266_send_cmd("AT+CIPSEND=0,11","OK",200); //发送指定长度的数据
printf("正常send");
delay_ms(200);
atk_8266_send_data(p,"OK",100); //发送指定长度的数据
timex=100;
Reset_RC522();
if(sd_ok)
{
LED1=0; //点亮DS1,提示正在拍照
camera_new_pathname(pname);//得到文件名
// bmp_encode(pname,(lcddev.width-240)/2,(lcddev.height-320)/2,240,320,0);
if(bmp_encode(pname,lcddev.width-260,(lcddev.height-320)/16,240,320,0))//拍照有误
{
Show_Str(140,560,240,12,"写入文件错误!",12,0);
}else
{
atk_8266_send_cmd("AT+CIPSEND=0,11","OK",200); //发送指定长度的数据
printf("正常send图片");
delay_ms(200);
atk_8266_send_data(pname,"OK",1000); //发送指定长度的数据
Show_Str(140,560,240,12,"拍照成功!",12,0);
Show_Str(140,580,240,12,"保存为:",12,0);
Show_Str(140+42,580,240,12,pname,12,0);
filename=pname;
res=f_open(f_bmp,(const TCHAR*)filename,FA_READ);//打开文件
if(res==0)//打开成功.
{
f_read(f_bmp,databuf,readlen,(UINT*)&br); //读出readlen个字节
pbmp=(BITMAPINFO*)databuf;//获取文件信息
atk_8266_send_cmd("AT+CIPSEND=0,11","OK",200); //发送指定长度的数据
atk_8266_send_data(databuf,"OK",1000); //发送指定长度的数据
}
BEEP=1; //蜂鸣器短叫,提示拍照完成
delay_ms(100);
}
}else //提示SD卡错误
{
Show_Str(140,600,240,12,"SD卡错误!",12,0);
Show_Str(140,620,240,12,"拍照功能不可用!",12,0);
}
BEEP=0;//关闭蜂鸣器
LED1=1;//关闭DS1
delay_ms(1000);//等待1.8秒钟 改为 1s
// LCD_Clear(WHITE);
|