add inner class structure

This commit is contained in:
Siwat Sirichai 2022-10-23 13:49:59 +07:00
parent 94720a74ce
commit 0395df8d30
11 changed files with 115 additions and 7 deletions

View File

@ -1,5 +1,5 @@
class collision:
def __init__(self, board) -> None:
self.board = board
def collision_handle(self):
pass

View File

@ -1,8 +1,12 @@
COLLISION_DETECTOR_PIN = 2
LEDS_DATA_PIN = 3
SERIAL_DRIVER_BOARD = "/dev/serial/by-id/..."
MOTOR_FL_F = 4
MOTOR_FL_R = 5
MOTOR_FR_F = 6
MOTOR_FL_R = 7
MOTOR_FR_R = 7
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

View File

@ -1,3 +1,15 @@
from kuukar_lcd import lcd
from kuukar_leds import leds
from kuukar_noise import noise
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):
pass
def handle_face_detected(self):
pass

View File

@ -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

View File

@ -1,2 +1,3 @@
class leds:
pass
def __init__(self, board, led_pin: int) -> None:
self.board = board

View File

@ -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

View File

@ -0,0 +1,2 @@
class noise():
pass

View File

@ -0,0 +1,4 @@
class sensors:
def __init__(self, board, driver) -> None:
self.board = board
self.driver = driver

View File

@ -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:
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)

View File

@ -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

View File

@ -1,2 +1,3 @@
telemetrix-rpi-pico
telemetrix
pyaudio