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