From 6c4d3c9d1f96f74cce121572a1807bea209a010f Mon Sep 17 00:00:00 2001 From: rudi Date: Wed, 18 Dec 2024 13:45:00 +0100 Subject: [PATCH] Playtime is over, first serious commit --- data writing.py | 10 ++++++++++ functions.py | 39 +++++++++++++++++++++++++++++++++++++++ main.py | 10 ++++++++++ min-max-demo.py | 3 +-- plotter.py | 6 ++++++ 5 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 data writing.py create mode 100644 functions.py create mode 100644 main.py create mode 100644 plotter.py diff --git a/data writing.py b/data writing.py new file mode 100644 index 0000000..6246699 --- /dev/null +++ b/data writing.py @@ -0,0 +1,10 @@ +def sensor_raw_data(): + pass + + +def pid_data(): + pass + + +def servo_raw_data(): + pass \ No newline at end of file diff --git a/functions.py b/functions.py new file mode 100644 index 0000000..97fb9f1 --- /dev/null +++ b/functions.py @@ -0,0 +1,39 @@ +import gpiozero as gp +from time import sleep + + +def system_test(): + ... +# todo Test niet mogelijk. Verwijderen? + + +def initial(): + ... + + +def calibrate(): + ... + + +def read_distance_sensor(): + ... + + +def read_setpoint(): + ... + + +def calculate_position(): + ... + + +def process_pid(): + ... + + +def calculate_new_servo_pos(): + ... + + +def send_data_to_servo(): + ... \ No newline at end of file diff --git a/main.py b/main.py new file mode 100644 index 0000000..967ab7b --- /dev/null +++ b/main.py @@ -0,0 +1,10 @@ +import functions +from functions import initial + +aaa = initial() + +# todo Moet nog formule in + + + + diff --git a/min-max-demo.py b/min-max-demo.py index a34d678..81d383f 100644 --- a/min-max-demo.py +++ b/min-max-demo.py @@ -2,7 +2,6 @@ # Once connected the easiest way to get your servo moving is to use the Gpiozero library in a Python script. - from gpiozero import Servo from time import sleep @@ -22,4 +21,4 @@ while True: sleep(0.5) servo.max() print("max") - sleep(1) + sleep(1) \ No newline at end of file diff --git a/plotter.py b/plotter.py new file mode 100644 index 0000000..342acae --- /dev/null +++ b/plotter.py @@ -0,0 +1,6 @@ +def read_data_file(): + pass + + +def plot_graphs(): + pass