programme course avec menu amélioré
Fork of Programme_course_vir_am_2 by
camera.cpp
- Committer:
- leandre
- Date:
- 2017-03-22
- Revision:
- 4:8b0215ec788f
- Parent:
- 0:3ec7fc598e48
File content as of revision 4:8b0215ec788f:
#include "Mlib.h" /****************CAMERA****************/ void F_GetData() { timer.reset(); begin = timer.read_us(); SI = 0; char numero_data = 0; while(timer.read_us() < begin+tempsInte); clk_active = 1; Impulse_SI(); while(CLK.read() == 0); cam_data[0] = AIN.read_u16()>>8; while(CLK.read() == 1); for(numero_data = 1; numero_data < 128; numero_data++) { while(CLK.read() == 0);//On attends le front montant cam_data[numero_data] = AIN.read_u16()>>8;//mémorisation des données while(CLK.read() == 1);//on attends le front descendant } clk_active = 0; SI = 1; } void F_CLK() { if(clk_active) { CLK = 1-CLK; } } void Impulse_SI() { while(CLK == 0); while(CLK == 1); SI = 1; while(CLK == 0); SI = 0; }