Gottfried Enenkel
/
_B16_T4_Line
BERTL16 Line Test
main.cpp@3:5c3f86316047, 2016-01-13 (annotated)
- Committer:
- MehmedCustic
- Date:
- Wed Jan 13 12:52:29 2016 +0000
- Revision:
- 3:5c3f86316047
- Parent:
- 2:90c675f0505a
- Child:
- 4:ca8a6436d16b
B15_T3_Line
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Enenkel | 0:a8a0195ed7dc | 1 | /*********************************** |
MehmedCustic | 3:5c3f86316047 | 2 | Name: BERTL15_LINE SENSOR_TEST |
MehmedCustic | 3:5c3f86316047 | 3 | Author: Enenkel |
Enenkel | 0:a8a0195ed7dc | 4 | description: |
MehmedCustic | 3:5c3f86316047 | 5 | Die Tasten vom I2C Expander werden direkt auf die LED's des Expander geschalten |
Enenkel | 0:a8a0195ed7dc | 6 | ***********************************/ |
Enenkel | 0:a8a0195ed7dc | 7 | #include "mbed.h" |
Enenkel | 1:d646fe79bc6c | 8 | |
Enenkel | 2:90c675f0505a | 9 | DigitalOut Von (P1_2); // Motor Spannung ON |
Enenkel | 2:90c675f0505a | 10 | DigitalOut LineON (P1_6); // Line Sensor aktivieren |
Enenkel | 2:90c675f0505a | 11 | DigitalIn ISO1 (P0_14); // ISO1 |
Enenkel | 2:90c675f0505a | 12 | DigitalIn ISO2 (P0_12); |
Enenkel | 2:90c675f0505a | 13 | DigitalIn ISO3 (P0_16); |
Enenkel | 2:90c675f0505a | 14 | DigitalIn ISO4 (P0_13); |
Enenkel | 2:90c675f0505a | 15 | DigitalIn ISO5 (P0_22); // OSI5 |
Enenkel | 2:90c675f0505a | 16 | DigitalOut LedD10 (P1_8); // Led D10 |
Enenkel | 2:90c675f0505a | 17 | DigitalOut LedD11 (P1_9); |
Enenkel | 2:90c675f0505a | 18 | DigitalOut LedD12 (P1_10); |
Enenkel | 2:90c675f0505a | 19 | DigitalOut LedD13 (P1_11); |
Enenkel | 2:90c675f0505a | 20 | DigitalOut LedBlue (P1_28); // Unterboden LED blau |
Enenkel | 2:90c675f0505a | 21 | |
Enenkel | 2:90c675f0505a | 22 | |
Enenkel | 0:a8a0195ed7dc | 23 | int main() { |
Enenkel | 2:90c675f0505a | 24 | Von=1; // 12 V leitung EIN |
Enenkel | 2:90c675f0505a | 25 | LineON=1; // Line Sensoren AKTIV |
Enenkel | 2:90c675f0505a | 26 | |
Enenkel | 0:a8a0195ed7dc | 27 | while(1) { |
Enenkel | 1:d646fe79bc6c | 28 | // Auswertung der LINE SENSOREN |
Enenkel | 2:90c675f0505a | 29 | if (ISO1 == 1 ) // Line Sensor ganz LINKS |
Enenkel | 1:d646fe79bc6c | 30 | { |
Enenkel | 2:90c675f0505a | 31 | LedD10=1; // Mit dem FINGER LED's einzeln abdunkeln! |
Enenkel | 2:90c675f0505a | 32 | } else{ |
Enenkel | 2:90c675f0505a | 33 | LedD10=0; |
Enenkel | 2:90c675f0505a | 34 | } |
Enenkel | 2:90c675f0505a | 35 | if (ISO2 == 1) // Line Sensor LINKS |
Enenkel | 2:90c675f0505a | 36 | { |
Enenkel | 2:90c675f0505a | 37 | LedD11=1; |
Enenkel | 2:90c675f0505a | 38 | } else { |
Enenkel | 2:90c675f0505a | 39 | LedD11=0; |
Enenkel | 2:90c675f0505a | 40 | } |
Enenkel | 2:90c675f0505a | 41 | if (ISO3 == 1) // Line Sensor RECHTS |
Enenkel | 1:d646fe79bc6c | 42 | { |
Enenkel | 2:90c675f0505a | 43 | LedD12=1; |
Enenkel | 2:90c675f0505a | 44 | } else { |
Enenkel | 2:90c675f0505a | 45 | LedD12=0; |
Enenkel | 2:90c675f0505a | 46 | } |
Enenkel | 2:90c675f0505a | 47 | if (ISO4 == 1) // Line Sensor ganz RECHT |
Enenkel | 1:d646fe79bc6c | 48 | { |
Enenkel | 2:90c675f0505a | 49 | LedD13=1; |
Enenkel | 2:90c675f0505a | 50 | } else{ |
Enenkel | 2:90c675f0505a | 51 | LedD13=0; |
Enenkel | 2:90c675f0505a | 52 | } |
Enenkel | 2:90c675f0505a | 53 | if (ISO5 == 1) // Line Sensor MITTE |
Enenkel | 1:d646fe79bc6c | 54 | { |
Enenkel | 2:90c675f0505a | 55 | LedBlue=0; |
Enenkel | 2:90c675f0505a | 56 | } else { |
Enenkel | 2:90c675f0505a | 57 | LedBlue=1; |
Enenkel | 2:90c675f0505a | 58 | } |
Enenkel | 0:a8a0195ed7dc | 59 | } |
Enenkel | 0:a8a0195ed7dc | 60 | } |
Enenkel | 0:a8a0195ed7dc | 61 |