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
Fork of MicroMouse_MASTER_FIVE by
KontrastSensor.cpp@9:ab19796bf14a, 2018-05-16 (annotated)
- Committer:
- ruesipat
- Date:
- Wed May 16 16:41:44 2018 +0000
- Revision:
- 9:ab19796bf14a
- Parent:
- 7:5ef09519a6e9
;
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| ruesipat | 1:d9e840c48b1e | 1 | #include <cmath> |
| ruesipat | 1:d9e840c48b1e | 2 | #include "KontrastSensor.h" |
| ruesipat | 1:d9e840c48b1e | 3 | |
| ruesipat | 1:d9e840c48b1e | 4 | using namespace std; |
| ruesipat | 1:d9e840c48b1e | 5 | |
| ruesipat | 1:d9e840c48b1e | 6 | KontrastSensor::KontrastSensor(AnalogIn& kontrast, int& blackLine) : |
| ruesipat | 1:d9e840c48b1e | 7 | kontrast(kontrast), |
| ruesipat | 1:d9e840c48b1e | 8 | blackLine(blackLine) |
| ruesipat | 1:d9e840c48b1e | 9 | { |
| ruesipat | 9:ab19796bf14a | 10 | |
| ruesipat | 1:d9e840c48b1e | 11 | } |
| ruesipat | 1:d9e840c48b1e | 12 | |
| ruesipat | 1:d9e840c48b1e | 13 | KontrastSensor::~KontrastSensor() {} |
| ruesipat | 1:d9e840c48b1e | 14 | |
| ruesipat | 1:d9e840c48b1e | 15 | void KontrastSensor::check() |
| ruesipat | 1:d9e840c48b1e | 16 | { |
| ruesipat | 9:ab19796bf14a | 17 | float k = kontrast*3300.0f; //sodass in Range bis 3300mV |
| ruesipat | 1:d9e840c48b1e | 18 | |
| ruesipat | 7:5ef09519a6e9 | 19 | if(k >2500.0f){ |
| ruesipat | 1:d9e840c48b1e | 20 | blackLine = 1; |
| ruesipat | 1:d9e840c48b1e | 21 | } |
| ruesipat | 1:d9e840c48b1e | 22 | } |
