![](/media/cache/group/ep_LV4vK4D.webp.50x50_q85.jpg)
Tueroeffner Beispiel
Dependencies: mbed
Ein Türöffner braucht eine höhere Spannung (12 Volt) als das Board zur Verfügung stellen kann. Deshalb ist ein Verstärker, z.B. MOSFET, voranzuschalten.
Der Türöffner wird an den LED-Strip Header (+ und 2. Pin) angeschlossen und mittels DigitalOut angesprochen.
Anwendungen
- Elektrische Türöffner
- Schliesssysstem, z.B. in Verbindung mit RFID Reader
main.cpp@0:c0f7038c55ae, 2015-03-23 (annotated)
- Committer:
- marcel1691
- Date:
- Mon Mar 23 17:19:27 2015 +0000
- Revision:
- 0:c0f7038c55ae
- Child:
- 1:8aee336e042b
Tueroeffner Beispiel
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
marcel1691 | 0:c0f7038c55ae | 1 | /** Tueroeffner Beispiel |
marcel1691 | 0:c0f7038c55ae | 2 | */ |
marcel1691 | 0:c0f7038c55ae | 3 | #include "mbed.h" |
marcel1691 | 0:c0f7038c55ae | 4 | |
marcel1691 | 0:c0f7038c55ae | 5 | DigitalIn button( PTC9, PullUp ); |
marcel1691 | 0:c0f7038c55ae | 6 | DigitalOut door( D13 ); |
marcel1691 | 0:c0f7038c55ae | 7 | |
marcel1691 | 0:c0f7038c55ae | 8 | int main() |
marcel1691 | 0:c0f7038c55ae | 9 | { |
marcel1691 | 0:c0f7038c55ae | 10 | while ( 1 ) |
marcel1691 | 0:c0f7038c55ae | 11 | { |
marcel1691 | 0:c0f7038c55ae | 12 | if ( button == 0 ) |
marcel1691 | 0:c0f7038c55ae | 13 | { |
marcel1691 | 0:c0f7038c55ae | 14 | door = 1; |
marcel1691 | 0:c0f7038c55ae | 15 | wait( 3.0 ); |
marcel1691 | 0:c0f7038c55ae | 16 | door = 0; |
marcel1691 | 0:c0f7038c55ae | 17 | } |
marcel1691 | 0:c0f7038c55ae | 18 | wait( 0.2 ); |
marcel1691 | 0:c0f7038c55ae | 19 | } |
marcel1691 | 0:c0f7038c55ae | 20 | } |