Gottfried Enenkel
/
_B16_T4_Line
BERTL16 Line Test
main.cpp@5:7ee80c79730e, 2016-04-29 (annotated)
- Committer:
- Enenkel
- Date:
- Fri Apr 29 09:10:47 2016 +0000
- Revision:
- 5:7ee80c79730e
- Parent:
- 4:ca8a6436d16b
- Child:
- 6:8144f23e1d72
_B16_T4_Line Testet dir LINE Sensorn
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Enenkel | 0:a8a0195ed7dc | 1 | /*********************************** |
Enenkel | 4:ca8a6436d16b | 2 | Name: BERTL16_LINE SENSOR_TEST |
MehmedCustic | 3:5c3f86316047 | 3 | Author: Enenkel |
Enenkel | 0:a8a0195ed7dc | 4 | description: |
Enenkel | 4:ca8a6436d16b | 5 | Test der ISO LINE SENSOREN |
Enenkel | 4:ca8a6436d16b | 6 | je abgedunkeltem SENSOR leuchtet eine LED |
Enenkel | 0:a8a0195ed7dc | 7 | ***********************************/ |
Enenkel | 0:a8a0195ed7dc | 8 | #include "mbed.h" |
Enenkel | 1:d646fe79bc6c | 9 | |
Enenkel | 4:ca8a6436d16b | 10 | DigitalOut Von (P2_13); // 12 V ON |
Enenkel | 4:ca8a6436d16b | 11 | DigitalOut LineON (P2_5); // Line Sensor aktivieren |
Enenkel | 4:ca8a6436d16b | 12 | DigitalIn ISO1 (P1_9); // ISO1 |
Enenkel | 4:ca8a6436d16b | 13 | DigitalIn ISO2 (P0_16); |
Enenkel | 4:ca8a6436d16b | 14 | DigitalIn ISO3 (P0_23); |
Enenkel | 4:ca8a6436d16b | 15 | DigitalIn ISO4 (P0_15); |
Enenkel | 4:ca8a6436d16b | 16 | DigitalIn ISO5 (P1_3); // OSI5 |
Enenkel | 4:ca8a6436d16b | 17 | DigitalOut LedD1 (P1_10); // Led D1 |
Enenkel | 4:ca8a6436d16b | 18 | DigitalOut LedD2 (P1_11); |
Enenkel | 4:ca8a6436d16b | 19 | DigitalOut LedD4 (P1_12); |
Enenkel | 4:ca8a6436d16b | 20 | DigitalOut LedD5 (P1_13); |
Enenkel | 4:ca8a6436d16b | 21 | DigitalOut LedD13 (P1_21); |
Enenkel | 4:ca8a6436d16b | 22 | DigitalOut LedD12 (P1_20); |
Enenkel | 2:90c675f0505a | 23 | |
Enenkel | 2:90c675f0505a | 24 | |
Enenkel | 0:a8a0195ed7dc | 25 | int main() { |
Enenkel | 2:90c675f0505a | 26 | Von=1; // 12 V leitung EIN |
Enenkel | 2:90c675f0505a | 27 | LineON=1; // Line Sensoren AKTIV |
Enenkel | 2:90c675f0505a | 28 | |
Enenkel | 0:a8a0195ed7dc | 29 | while(1) { |
Enenkel | 1:d646fe79bc6c | 30 | // Auswertung der LINE SENSOREN |
Enenkel | 2:90c675f0505a | 31 | if (ISO1 == 1 ) // Line Sensor ganz LINKS |
Enenkel | 1:d646fe79bc6c | 32 | { |
Enenkel | 5:7ee80c79730e | 33 | LedD2=0; // Mit dem FINGER LED's einzeln abdunkeln! |
Enenkel | 2:90c675f0505a | 34 | } else{ |
Enenkel | 5:7ee80c79730e | 35 | LedD2=1; |
Enenkel | 2:90c675f0505a | 36 | } |
Enenkel | 2:90c675f0505a | 37 | if (ISO2 == 1) // Line Sensor LINKS |
Enenkel | 2:90c675f0505a | 38 | { |
Enenkel | 5:7ee80c79730e | 39 | LedD1=0; |
Enenkel | 2:90c675f0505a | 40 | } else { |
Enenkel | 5:7ee80c79730e | 41 | LedD1=1; |
Enenkel | 2:90c675f0505a | 42 | } |
Enenkel | 2:90c675f0505a | 43 | if (ISO3 == 1) // Line Sensor RECHTS |
Enenkel | 1:d646fe79bc6c | 44 | { |
Enenkel | 5:7ee80c79730e | 45 | LedD4=0; |
Enenkel | 2:90c675f0505a | 46 | } else { |
Enenkel | 5:7ee80c79730e | 47 | LedD4=1; |
Enenkel | 2:90c675f0505a | 48 | } |
Enenkel | 2:90c675f0505a | 49 | if (ISO4 == 1) // Line Sensor ganz RECHT |
Enenkel | 1:d646fe79bc6c | 50 | { |
Enenkel | 5:7ee80c79730e | 51 | LedD5=0; |
Enenkel | 2:90c675f0505a | 52 | } else{ |
Enenkel | 5:7ee80c79730e | 53 | LedD5=1; |
Enenkel | 2:90c675f0505a | 54 | } |
Enenkel | 2:90c675f0505a | 55 | if (ISO5 == 1) // Line Sensor MITTE |
Enenkel | 1:d646fe79bc6c | 56 | { |
Enenkel | 5:7ee80c79730e | 57 | LedD13=LedD12=0; |
Enenkel | 2:90c675f0505a | 58 | } else { |
Enenkel | 5:7ee80c79730e | 59 | LedD13=LedD12=1; |
Enenkel | 2:90c675f0505a | 60 | } |
Enenkel | 5:7ee80c79730e | 61 | wait (0.05); |
Enenkel | 0:a8a0195ed7dc | 62 | } |
Enenkel | 0:a8a0195ed7dc | 63 | } |
Enenkel | 0:a8a0195ed7dc | 64 |