update documentation

This commit is contained in:
Konstantin Lampalzer 2021-09-13 19:14:47 +02:00
parent 54320096fb
commit 3ef0fff256
6 changed files with 205 additions and 18 deletions

View file

@ -12,7 +12,7 @@ class Display(object):
""" """
@staticmethod @staticmethod
def write(line: int, text: string): def write(line: int, text: str):
"""Write a string of text to the integrated display. """Write a string of text to the integrated display.
:param line: Line to write. Between 1 and 4 :param line: Line to write. Between 1 and 4

View file

@ -172,7 +172,6 @@ class Spi(object):
if Spi.read(Register.IDENTIFICATION_MODEL_ID, 1) != 3: if Spi.read(Register.IDENTIFICATION_MODEL_ID, 1) != 3:
Logging.get_logger().error(f"Unable to read Version! Make sure the mainboard is connected!") Logging.get_logger().error(f"Unable to read Version! Make sure the mainboard is connected!")
print("Unable to read Version! Make sure the mainboard is connected!") print("Unable to read Version! Make sure the mainboard is connected!")
sys.exit()
@staticmethod @staticmethod
def start_health_check_loop(): def start_health_check_loop():

View file

@ -26,16 +26,16 @@ else:
print("apt is not installed! This is for local development only!") print("apt is not installed! This is for local development only!")
if spi_found: if spi_found:
import compLib.Spi from compLib.Spi import Spi
import compLib.Reset from compLib.Reset import Reset
import compLib.Encoder from compLib.Encoder import Encoder
import logging import logging
print(f"\033[34mInitializing chipmunk board...\033[0m") print(f"\033[34mInitializing chipmunk board...\033[0m")
compLib.Reset.Reset.reset_bot() Reset.reset_bot()
compLib.Spi.Spi.health_check() Spi.health_check()
compLib.Spi.Spi.start_health_check_loop() Spi.start_health_check_loop()
compLib.Encoder.Encoder.clear_all() Encoder.clear_all()
print(f"\033[34mReady\033[0m\n") print(f"\033[34mReady\033[0m\n")
else: else:
print("spidev is not installed! This is for local development only!") print("spidev is not installed! This is for local development only!")

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 188 KiB

View file

@ -1,14 +1,12 @@
Robo4you Competition Library .. image:: images/compair-logo-white.svg
Competition Robot Library
############################# #############################
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
:caption: Contents: :caption: Contents:
CompLib is the library used in the robo4you competition 2021.
Contents Contents
********* *********

View file

@ -9,12 +9,13 @@ Usage
from compLib.Motor import * from compLib.Motor import *
def forward(): def forward():
for port in range(0, 4): Motor.power(1, -30);
Motor.power(port, 30); Motor.power(2, 30);
def backward(): def backward():
for port in range(0, 4): Motor.power(1, 30);
Motor.power(port, -30); Motor.power(2, -30);
def main(): def main():
print("hallo ich bin ein roboter beep buup") print("hallo ich bin ein roboter beep buup")