better handle roaming loop
This commit is contained in:
		
							parent
							
								
									ded055a790
								
							
						
					
					
						commit
						88734ec168
					
				
					 2 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -79,5 +79,5 @@ class leds:
 | 
			
		|||
            print(leds.__blink_func(self.__get_time(), duration))
 | 
			
		||||
            time.sleep(0.05)
 | 
			
		||||
            if self.__get_time() > duration:
 | 
			
		||||
                flashing = False
 | 
			
		||||
                self.flashing = False
 | 
			
		||||
                break
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -110,6 +110,7 @@ class motion:
 | 
			
		|||
        while True:
 | 
			
		||||
            if self.roaming:
 | 
			
		||||
                self.__roam_handle()
 | 
			
		||||
            time.sleep(0.3)
 | 
			
		||||
 | 
			
		||||
    def __roam_handle(self):
 | 
			
		||||
        sensitivity = 35
 | 
			
		||||
| 
						 | 
				
			
			@ -150,4 +151,3 @@ class motion:
 | 
			
		|||
                    self.drive(drive_speed)
 | 
			
		||||
        if not self.roaming:
 | 
			
		||||
            self.stop()
 | 
			
		||||
        time.sleep(0.3)
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue