Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
main.cpp
- Committer:
- xkzy
- Date:
- 2018-12-15
- Revision:
- 0:e191453b86ba
File content as of revision 0:e191453b86ba:
#include "mbed.h"
RawSerial pc(SERIAL_TX, SERIAL_RX); //has to use rawserial ,serial too slow and has byte loss.
RawSerial cam(PA_11, PA_12);
DigitalOut read_state(LED1);
InterruptIn frame_start(PC_5);
uint8_t image[76800];
uint32_t pix_count;
bool reading;
void count_reset(){
pix_count = 0;
reading=!reading;
}
int main() {
pc.baud(2000000);
cam.baud(2000000);
frame_start.fall(&count_reset);
while(1) {
pix_count=0;
while(pix_count<76800){
if(cam.readable()) {
image[pix_count++]=cam.getc();
}
}
for(int u=0;u<76800;u++){
pc.putc(image[u]);
}
}
}