mirror of
https://github.com/kevinveenbirkenbach/erinaco.git
synced 2024-11-23 14:31:04 +01:00
Metermessfunktion hinzugefuegt
This commit is contained in:
parent
62bf65aa33
commit
50001662b3
18
skalieren.py
18
skalieren.py
@ -4,19 +4,25 @@ import time
|
||||
core=CORE()
|
||||
core.setSensorValues()
|
||||
core.printValues()
|
||||
print("Zum fortfahren beliebige Taste druecken...");
|
||||
getch.getch();
|
||||
core.turnRight();
|
||||
def trackTime():
|
||||
|
||||
startTime=time.time();
|
||||
whileStatus=0
|
||||
while True:
|
||||
if core.infarotMitteRechts.getValue():
|
||||
if whileStatus==1:
|
||||
runTime=time.time()-startTime;
|
||||
core.stop();
|
||||
print("Die ausfuehrzeit betraegt {0} Sekunden.".format(time.time()-startTime));
|
||||
break;
|
||||
else:
|
||||
whileStatus=1;
|
||||
print("Die ausfuehrzeit betraegt {0} Sekunden.".format(runTime));
|
||||
print("Auswaehlen: Sekunden pro Meter(m) oder Sekunden pro turn...");
|
||||
if(getch.getch()=='m'):
|
||||
core.forward();
|
||||
trackTime();
|
||||
core.stop();
|
||||
else:
|
||||
core.turnRight();
|
||||
trackTime();
|
||||
core.stop();
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user