Compare commits
2 Commits
ded055a790
...
e4821b3c6f
Author | SHA1 | Date |
---|---|---|
Siwat Sirichai | e4821b3c6f | |
Siwat Sirichai | 88734ec168 |
4
app.py
4
app.py
|
@ -9,8 +9,8 @@ import kuukar.kuukar_environment as kuukar_environment
|
||||||
|
|
||||||
from kuukar.kuukar_config import SERIAL_MCU, SERIAL_DRV
|
from kuukar.kuukar_config import SERIAL_MCU, SERIAL_DRV
|
||||||
|
|
||||||
mcu = telemetrix_rpi_pico.TelemetrixRpiPico(com_port=SERIAL_MCU)
|
mcu = telemetrix_rpi_pico.TelemetrixRpiPico(com_port=SERIAL_MCU, sleep_tune=0.001)
|
||||||
drv = telemetrix_rpi_pico.TelemetrixRpiPico(com_port=SERIAL_DRV)
|
drv = telemetrix_rpi_pico.TelemetrixRpiPico(com_port=SERIAL_DRV, sleep_tune=0.001)
|
||||||
sensors = kuukar_sensors.sensors(mcu)
|
sensors = kuukar_sensors.sensors(mcu)
|
||||||
leds = kuukar_leds.leds(mcu)
|
leds = kuukar_leds.leds(mcu)
|
||||||
motion = kuukar_motion.motion(mcu, drv, leds, sensors)
|
motion = kuukar_motion.motion(mcu, drv, leds, sensors)
|
||||||
|
|
|
@ -79,5 +79,5 @@ class leds:
|
||||||
print(leds.__blink_func(self.__get_time(), duration))
|
print(leds.__blink_func(self.__get_time(), duration))
|
||||||
time.sleep(0.05)
|
time.sleep(0.05)
|
||||||
if self.__get_time() > duration:
|
if self.__get_time() > duration:
|
||||||
flashing = False
|
self.flashing = False
|
||||||
break
|
break
|
||||||
|
|
|
@ -110,6 +110,7 @@ class motion:
|
||||||
while True:
|
while True:
|
||||||
if self.roaming:
|
if self.roaming:
|
||||||
self.__roam_handle()
|
self.__roam_handle()
|
||||||
|
time.sleep(0.3)
|
||||||
|
|
||||||
def __roam_handle(self):
|
def __roam_handle(self):
|
||||||
sensitivity = 35
|
sensitivity = 35
|
||||||
|
@ -150,4 +151,3 @@ class motion:
|
||||||
self.drive(drive_speed)
|
self.drive(drive_speed)
|
||||||
if not self.roaming:
|
if not self.roaming:
|
||||||
self.stop()
|
self.stop()
|
||||||
time.sleep(0.3)
|
|
Loading…
Reference in New Issue