Programmcodes Einzelblattstapelbildung / Mbed 2 deprecated Bahnkantenregelung_Julian

Dependencies:   TextLCD mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers hand_func.cpp Source File

hand_func.cpp

00001 /**
00002 *Funktionen fuer den Handbetrieb
00003 *
00004 *CPP-Datei hand_func.cpp
00005 *
00006 *@version: 01.11.2015
00007 *@author: Gustav Grether
00008 */
00009 
00010 #include "hand_func.h"
00011 #include "edge_func.h"
00012 
00013 //Variablen fuer Handbetrieb
00014 int hand_curPx;
00015 Ticker tickerDispPx; //Ticker zum Aktualisieren der Kantenposition auf dem Display im Handbetrieb
00016 
00017 
00018 void hand_setup()
00019 {
00020     lcd.cls();
00021     lcd.locate(0,0);
00022     lcd.printf("Hand");
00023     lcd.locate(0,1);
00024     lcd.printf("Pos Px=    >auto");
00025     //aktualisiere Kantenposition auf dem Display jede 0.5 Sekunden
00026     tickerDispPx.attach(&dispPx,0.5);
00027 }
00028 
00029 void hand_end()
00030 {
00031     tickerDispPx.detach();
00032 }
00033 
00034 void dispPx()
00035 {
00036     hand_curPx=edgePx_get();
00037     if(hand_curPx<0) { //Fehlermeldung anzeigen
00038         lcd.locate(0,1);
00039         lcd.printf("ERROR Nr.%i  ",hand_curPx);
00040     } else {
00041         lcd.locate(0,1);
00042         lcd.printf("Pos Px=%i  ",hand_curPx);
00043     }
00044 }