涂 桂旺
/
JPEGCamera_SIM808_STM32F401RE
test program for SIM808 GPRS + JPEG Camera library for LinkSprite LS-Y201 camera
main.cpp
- Committer:
- tgw
- Date:
- 2017-06-09
- Revision:
- 2:9ad661c031a4
- Parent:
- 0:0c9cdf074ba1
- Child:
- 3:f307a059affe
File content as of revision 2:9ad661c031a4:
#include "mbed.h" #include "JPEGCamera.h" Serial control(SERIAL_TX, SERIAL_RX); // tx, rx read from bluetooth module VERIFIED JPEGCamera camera(PA_9, PA_10); // TX, RX to camera //Camera time Timer timer; int main() { int message = 0; control.baud(115200); //Camera Initialization and picture sizing timer.start(); if(camera.setPictureSize(JPEGCamera::SIZE160x120)) { control.printf("D 3 \n"); } else { control.printf("D 4 \n"); } wait(3); //Continuously wait for commands while(1) { //Check for bytes over serial from bluetooth/xbee if(control.readable()) { message=control.getc(); //Take a picture (note that this takes a while to complete and will only only work for 999 pictures if (message==210) { if (camera.isReady()) { if (camera.takePicture()) { int image_size = camera.getImageSize(); while (camera.isProcessing()) { camera.processPicture(control); } } else { control.printf("D 1 \n"); } } else { control.printf("D 0 \n"); } } } } }