From f739f34f75b3d5d671f2fd512229ef69826d0b9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20J=C3=B6nsson?= Date: Wed, 7 May 2025 14:35:50 +0200 Subject: [PATCH] started with class for motorcontroller --- raspberry/leds.py | 7 +++++++ raspberry/motors.py | 13 +++++++++++++ raspberry/terradrone.py | 10 ++++++++++ 3 files changed, 30 insertions(+) create mode 100644 raspberry/leds.py create mode 100644 raspberry/motors.py create mode 100644 raspberry/terradrone.py diff --git a/raspberry/leds.py b/raspberry/leds.py new file mode 100644 index 0000000..1a1821d --- /dev/null +++ b/raspberry/leds.py @@ -0,0 +1,7 @@ +#################################################################### +# This file contains the code to control the LEDs of the robot. +# +#################################################################### +from gpiozero import LED +from time import sleep + diff --git a/raspberry/motors.py b/raspberry/motors.py new file mode 100644 index 0000000..eadfb2f --- /dev/null +++ b/raspberry/motors.py @@ -0,0 +1,13 @@ +#################################################################### +# This file contains the code to control the motors of the robot. +# +# The motors are controlled using PWM signals. +# The code is designed to work with the L298N motor driver. +# The code is designed to work with the Raspberry Pi 5. +###################################################################### +from gpiozero import Motor, PWMOutputDevice +from time import sleep + +class Motor: + def __init__(self, motor_pin1, motor_pin2, pwm_pin): + pass \ No newline at end of file diff --git a/raspberry/terradrone.py b/raspberry/terradrone.py new file mode 100644 index 0000000..2601517 --- /dev/null +++ b/raspberry/terradrone.py @@ -0,0 +1,10 @@ +#################################################################### +# This file contains the main code to control the robot. +# +#################################################################### + +def main(): + pass + +if __name__ == "__main__": + main() \ No newline at end of file