add inner class structure
This commit is contained in:
parent
94720a74ce
commit
0395df8d30
|
@ -1,5 +1,5 @@
|
||||||
class collision:
|
class collision:
|
||||||
def __init__(self, board) -> None:
|
def __init__(self, board) -> None:
|
||||||
|
self.board = board
|
||||||
def collision_handle(self):
|
def collision_handle(self):
|
||||||
pass
|
pass
|
|
@ -1,8 +1,12 @@
|
||||||
COLLISION_DETECTOR_PIN = 2
|
SERIAL_DRIVER_BOARD = "/dev/serial/by-id/..."
|
||||||
LEDS_DATA_PIN = 3
|
|
||||||
MOTOR_FL_F = 4
|
MOTOR_FL_F = 4
|
||||||
MOTOR_FL_R = 5
|
MOTOR_FL_R = 5
|
||||||
MOTOR_FR_F = 6
|
MOTOR_FR_F = 6
|
||||||
MOTOR_FL_R = 7
|
MOTOR_FR_R = 7
|
||||||
MOTOR_R_F = 8
|
MOTOR_R_F = 8
|
||||||
MOTOR_R_R = 9
|
MOTOR_R_R = 9
|
||||||
|
|
||||||
|
SERIAL_AUX_BOARD = "/dev/serial/by-id/..."
|
||||||
|
COLLISION_DETECTOR_PIN = 2
|
||||||
|
LEDS_DATA_PIN = 3
|
||||||
|
DHT22_PIN = 5
|
||||||
|
|
12
kuukar_cv.py
12
kuukar_cv.py
|
@ -1,3 +1,15 @@
|
||||||
|
from kuukar_lcd import lcd
|
||||||
|
from kuukar_leds import leds
|
||||||
|
from kuukar_noise import noise
|
||||||
|
|
||||||
class cv:
|
class cv:
|
||||||
|
def __init__(self, lcd: lcd, leds: leds, noise: noise) -> None:
|
||||||
|
self.lcd = lcd
|
||||||
|
self.leds = leds
|
||||||
|
self.noise = noise
|
||||||
|
def capture_image(self):
|
||||||
|
pass
|
||||||
def detectFace(self, image):
|
def detectFace(self, image):
|
||||||
|
pass
|
||||||
|
def handle_face_detected(self):
|
||||||
pass
|
pass
|
|
@ -0,0 +1,26 @@
|
||||||
|
class lcd:
|
||||||
|
def __init__(self) -> None:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def keke_uwu(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def keke_hurt(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def takina_noise(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def play_video(self,filename: str) -> None:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def pause_video(self) -> None:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def resume_video(self) -> None:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def stop_video(self) -> None:
|
||||||
|
pass
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
class leds:
|
class leds:
|
||||||
pass
|
def __init__(self, board, led_pin: int) -> None:
|
||||||
|
self.board = board
|
|
@ -0,0 +1,29 @@
|
||||||
|
from kuukar_config import MOTOR_FL_F, MOTOR_FL_R, MOTOR_FR_F, MOTOR_FR_R, MOTOR_R_F, MOTOR_R_R
|
||||||
|
from kuukar_leds import leds
|
||||||
|
from kuukar_sensors import sensors
|
||||||
|
from telemetrix import telemetrix
|
||||||
|
|
||||||
|
class motion:
|
||||||
|
def __init__(self, driver: telemetrix.Telemetrix, led: leds, sensors: sensors) -> None:
|
||||||
|
self.driver = driver
|
||||||
|
self.leds = leds
|
||||||
|
self.sensors = sensors
|
||||||
|
|
||||||
|
drive_pins = [MOTOR_FL_F,MOTOR_FL_R,MOTOR_FR_F,MOTOR_FR_R,MOTOR_R_F,MOTOR_R_R]
|
||||||
|
for drive_pin in drive_pins:
|
||||||
|
self.driver.set_pin_mode_digital_output(drive_pin)
|
||||||
|
|
||||||
|
def forward(self, speed: int):
|
||||||
|
self.driver.digital_write(MOTOR_FL_F,1)
|
||||||
|
def turn(self, speed: int, angle: float):
|
||||||
|
pass
|
||||||
|
def backward(self, speed: int):
|
||||||
|
pass
|
||||||
|
def stop(self):
|
||||||
|
pass
|
||||||
|
def roam_start(self):
|
||||||
|
pass
|
||||||
|
def roam_stop(self):
|
||||||
|
pass
|
||||||
|
def roam_loop(self):
|
||||||
|
pass
|
|
@ -0,0 +1,2 @@
|
||||||
|
class noise():
|
||||||
|
pass
|
|
@ -0,0 +1,4 @@
|
||||||
|
class sensors:
|
||||||
|
def __init__(self, board, driver) -> None:
|
||||||
|
self.board = board
|
||||||
|
self.driver = driver
|
|
@ -1,2 +1,19 @@
|
||||||
|
import threading
|
||||||
|
from time import sleep
|
||||||
|
from kuukar_lcd import lcd
|
||||||
|
from kuukar_leds import leds
|
||||||
|
from kuukar_noise import noise
|
||||||
|
from kuukar_sensors import sensors
|
||||||
|
|
||||||
|
|
||||||
class temperature:
|
class temperature:
|
||||||
pass
|
def __init__(self, lcd: lcd, leds: leds, sensors: sensors, noise: noise) -> None:
|
||||||
|
self.lcd = lcd
|
||||||
|
self.leds = leds
|
||||||
|
self.sensors = sensors
|
||||||
|
self.noise = noise
|
||||||
|
threading.Thread(target=self.temperature_checker).start()
|
||||||
|
|
||||||
|
def temperature_checker(self):
|
||||||
|
while True:
|
||||||
|
sleep(5)
|
|
@ -0,0 +1,12 @@
|
||||||
|
from kuukar_lcd import lcd
|
||||||
|
from kuukar_leds import leds
|
||||||
|
from kuukar_noise import noise
|
||||||
|
|
||||||
|
|
||||||
|
class voice:
|
||||||
|
def __init__(self, lcd: lcd, leds: leds, noise: noise) -> None:
|
||||||
|
self.lcd = lcd
|
||||||
|
self.leds = leds
|
||||||
|
self.noise = noise
|
||||||
|
def handle_voice_prompt(self, command):
|
||||||
|
pass
|
|
@ -1,2 +1,3 @@
|
||||||
telemetrix-rpi-pico
|
telemetrix-rpi-pico
|
||||||
|
telemetrix
|
||||||
pyaudio
|
pyaudio
|
Loading…
Reference in New Issue