E=MC / Mbed 2 deprecated linecam_practice

Dependencies:   mbed

main.cpp

Committer:
ericoneill
Date:
2015-03-11
Revision:
2:f3eafd4d3705
Parent:
1:c6fa316ce7d1
Child:
3:4ba3d22e50dc

File content as of revision 2:f3eafd4d3705:

#include "mbed.h"

DigitalOut clk(PTA13);
DigitalOut si(PTD4);
AnalogIn camData(PTC2);
Timer t1;
int main() {
    //clk.period_us(2);
    //clk.pulsewidth_us(1);
    t1.start();
    //int integrationTime = 100 ;//SET THIS!!
    int integrationCounter = 0;
    while(1) {
        //int time = t1.read_us();
        //(t1.read_us()>integrationTime){
        if(integrationCounter % 120== 0){
            si = 1;
            clk = 1;
            //wait(.00001);
            si = 0;
            clk = 0;
            //integrationTime = time;
            t1.reset();
            //integrationCounter = 0;
        }
        else{
            clk = 1;
            clk = 0;
        }

        //clk = 0;
        integrationCounter++;
        //camData.
        
    }
}