![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Test Code for OV7670 Camera module. The images are sent over ethernet link.
Dependencies: EthernetInterface mbed-rtos mbed ov7670
You can find more information in this page: https://mbed.org/users/edodm85/notebook/ov7670-camera-and-ethernet-stream/
Diff: main.h
- Revision:
- 0:2208b72b1ba1
- Child:
- 2:d6b38a4512eb
diff -r 000000000000 -r 2208b72b1ba1 main.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.h Mon Jul 15 20:51:31 2013 +0000 @@ -0,0 +1,53 @@ +#pragma once +#include "mbed.h" +#include "ov7670.h" +#include "EthernetInterface.h" + + +#define ECHO_SERVER_PORT 2000 + + +Timer t; +bool new_send = false; + +DigitalOut led1(LED1); +DigitalOut led2(LED2); +DigitalOut led3(LED3); +DigitalOut led4(LED4); + +//Camera +OV7670 camera +( + p28,p27, // SDA,SCL(I2C / SCCB) + p23,p24,p25, // VSYNC,HREF,WEN(FIFO) + Port0,0x07878000, // PortIn data p18(P0.26),p17(P0.25),p16(P0.24),p15(P0.23),p11(P0.18),p12(P0.17),p14(P0.16),p13(P0.15) + p26,p29,p30 // RRST,OE,RCLK +); + +//ETHERNET +char* ip = "192.168.153.153"; // ip +char* mask = "255.255.255.0"; // mask +char* gateway = "192.168.153.5"; // gateway +EthernetInterface eth; +TCPSocketConnection client; +TCPSocketServer server; + +//ETHERNET BUFFER +char bufferRX[20]; +char bufferTX[9600]; + +//RESET +extern "C" void mbed_reset(); + +//TIMER +int t1 = 0; +int t2 = 0; + +//THREAD +void net_thread(void const *argument); +osThreadDef(net_thread, osPriorityNormal, DEFAULT_STACK_SIZE); + +//FUNCTION +void Send(); +void parse_cmd(); +void CameraSnap();