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@0:a7a8c6ef6d11, 2015-03-11 (annotated)
- Committer:
- ericoneill
- Date:
- Wed Mar 11 01:20:39 2015 +0000
- Revision:
- 0:a7a8c6ef6d11
- Child:
- 1:c6fa316ce7d1
line scan begin;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ericoneill | 0:a7a8c6ef6d11 | 1 | #include "mbed.h" |
ericoneill | 0:a7a8c6ef6d11 | 2 | |
ericoneill | 0:a7a8c6ef6d11 | 3 | DigitalOut clk(PTA13); |
ericoneill | 0:a7a8c6ef6d11 | 4 | DigitalOut pi(PTD5); |
ericoneill | 0:a7a8c6ef6d11 | 5 | AnalogIn camData(PTC2); |
ericoneill | 0:a7a8c6ef6d11 | 6 | Timer t1; |
ericoneill | 0:a7a8c6ef6d11 | 7 | int main() { |
ericoneill | 0:a7a8c6ef6d11 | 8 | //clk.period_us(2); |
ericoneill | 0:a7a8c6ef6d11 | 9 | //clk.pulsewidth_us(1); |
ericoneill | 0:a7a8c6ef6d11 | 10 | t1.start(); |
ericoneill | 0:a7a8c6ef6d11 | 11 | int integrationTime = ;//SET THIS!! |
ericoneill | 0:a7a8c6ef6d11 | 12 | while(1) { |
ericoneill | 0:a7a8c6ef6d11 | 13 | clk = 1; |
ericoneill | 0:a7a8c6ef6d11 | 14 | if(t1.read()<integrationTime){ |
ericoneill | 0:a7a8c6ef6d11 | 15 | pi = 1; |
ericoneill | 0:a7a8c6ef6d11 | 16 | p1 = 0; |
ericoneill | 0:a7a8c6ef6d11 | 17 | } |
ericoneill | 0:a7a8c6ef6d11 | 18 | clk = 0; |
ericoneill | 0:a7a8c6ef6d11 | 19 | camData. |
ericoneill | 0:a7a8c6ef6d11 | 20 | |
ericoneill | 0:a7a8c6ef6d11 | 21 | } |
ericoneill | 0:a7a8c6ef6d11 | 22 | } |