![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Temperatur und Luffeuchtigkeit ueber I^2 einlesen und an der serielen Schnittstelle ausgeben
main.cpp@2:538939bfd629, 2019-11-21 (annotated)
- Committer:
- happy_alien
- Date:
- Thu Nov 21 16:35:53 2019 +0000
- Revision:
- 2:538939bfd629
- Parent:
- 1:700f6e782bf9
- Child:
- 3:ab1d4af507d1
3errechts
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
happy_alien | 0:fd27a92aaa8c | 1 | #include "mbed.h" |
happy_alien | 0:fd27a92aaa8c | 2 | |
happy_alien | 0:fd27a92aaa8c | 3 | |
happy_alien | 0:fd27a92aaa8c | 4 | |
happy_alien | 0:fd27a92aaa8c | 5 | // D20,D19,D18,D17,... |
happy_alien | 0:fd27a92aaa8c | 6 | BusOut lb(D2,D3,D6,D9,D11,D12,A6,D13); |
happy_alien | 0:fd27a92aaa8c | 7 | |
happy_alien | 0:fd27a92aaa8c | 8 | |
happy_alien | 0:fd27a92aaa8c | 9 | |
happy_alien | 0:fd27a92aaa8c | 10 | DigitalIn T1(A2), T2(A1); |
happy_alien | 0:fd27a92aaa8c | 11 | |
happy_alien | 0:fd27a92aaa8c | 12 | |
happy_alien | 0:fd27a92aaa8c | 13 | void OneRunLightStep2(); |
happy_alien | 2:538939bfd629 | 14 | void Dreierlicht(); |
happy_alien | 0:fd27a92aaa8c | 15 | |
happy_alien | 0:fd27a92aaa8c | 16 | |
happy_alien | 0:fd27a92aaa8c | 17 | int main() |
happy_alien | 0:fd27a92aaa8c | 18 | |
happy_alien | 1:700f6e782bf9 | 19 | { |
happy_alien | 0:fd27a92aaa8c | 20 | while(1) |
happy_alien | 0:fd27a92aaa8c | 21 | { |
happy_alien | 1:700f6e782bf9 | 22 | if (T1==0) |
happy_alien | 2:538939bfd629 | 23 | OneRunLightStep2(); |
happy_alien | 2:538939bfd629 | 24 | if(T2==0) |
happy_alien | 2:538939bfd629 | 25 | Dreierlicht(); |
happy_alien | 0:fd27a92aaa8c | 26 | |
happy_alien | 0:fd27a92aaa8c | 27 | |
happy_alien | 0:fd27a92aaa8c | 28 | |
happy_alien | 0:fd27a92aaa8c | 29 | } |
happy_alien | 0:fd27a92aaa8c | 30 | |
happy_alien | 0:fd27a92aaa8c | 31 | } |
happy_alien | 0:fd27a92aaa8c | 32 | |
happy_alien | 0:fd27a92aaa8c | 33 | |
happy_alien | 0:fd27a92aaa8c | 34 | void OneRunLightStep2() |
happy_alien | 0:fd27a92aaa8c | 35 | { |
happy_alien | 0:fd27a92aaa8c | 36 | if(lb==0) |
happy_alien | 0:fd27a92aaa8c | 37 | lb=1; |
happy_alien | 0:fd27a92aaa8c | 38 | else |
happy_alien | 0:fd27a92aaa8c | 39 | lb=lb<<1; // Finster |
happy_alien | 0:fd27a92aaa8c | 40 | wait_ms(500); |
happy_alien | 0:fd27a92aaa8c | 41 | } |
happy_alien | 2:538939bfd629 | 42 | void Dreierlicht() |
happy_alien | 2:538939bfd629 | 43 | { |
happy_alien | 2:538939bfd629 | 44 | int i=0; |
happy_alien | 2:538939bfd629 | 45 | lb=1; |
happy_alien | 2:538939bfd629 | 46 | for(i=0;i<8;i++) |
happy_alien | 2:538939bfd629 | 47 | { |
happy_alien | 2:538939bfd629 | 48 | wait_ms(500); |
happy_alien | 2:538939bfd629 | 49 | if(i<2) |
happy_alien | 2:538939bfd629 | 50 | lb=(lb<<1) |1; |
happy_alien | 2:538939bfd629 | 51 | else |
happy_alien | 2:538939bfd629 | 52 | lb=(lb<<1); |
happy_alien | 2:538939bfd629 | 53 | |
happy_alien | 2:538939bfd629 | 54 | } |
happy_alien | 2:538939bfd629 | 55 | |
happy_alien | 2:538939bfd629 | 56 | |
happy_alien | 2:538939bfd629 | 57 | |
happy_alien | 2:538939bfd629 | 58 | |
happy_alien | 2:538939bfd629 | 59 | } |