Add QC docu, Fix display update
This commit is contained in:
parent
d81eb73b46
commit
42952eb9e1
2 changed files with 72 additions and 3 deletions
|
@ -60,10 +60,8 @@ def write_ip_to_screen():
|
||||||
try:
|
try:
|
||||||
ip = str(get_ip())
|
ip = str(get_ip())
|
||||||
print(f"writing {ip} to display")
|
print(f"writing {ip} to display")
|
||||||
Logging.get_logger().info(f"writing {ip} to display")
|
|
||||||
Display.write(1, "Current IP:")
|
|
||||||
Display.write(2, ip)
|
Display.write(2, ip)
|
||||||
Display.write(3, datetime.datetime.now().strftime("%b %d %H:%M:%S"))
|
Display.write(1, datetime.datetime.now().strftime("%b %d %H:%M:%S"))
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Exception in write ip thread: {e}")
|
print(f"Exception in write ip thread: {e}")
|
||||||
|
|
71
docs/source/lib/QC.rst
Normal file
71
docs/source/lib/QC.rst
Normal file
|
@ -0,0 +1,71 @@
|
||||||
|
.. _lib_qc:
|
||||||
|
|
||||||
|
Quality Control
|
||||||
|
###############
|
||||||
|
|
||||||
|
Infrared Test
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
from compLib.IRSensor import IRSensor
|
||||||
|
import time
|
||||||
|
|
||||||
|
IRSensor.set(1, True)
|
||||||
|
IRSensor.set(2, True)
|
||||||
|
IRSensor.set(3, True)
|
||||||
|
IRSensor.set(4, True)
|
||||||
|
IRSensor.set(5, True)
|
||||||
|
|
||||||
|
while True:
|
||||||
|
t = time.time()
|
||||||
|
for i in range(1, 6):
|
||||||
|
print(f"{i}: {IRSensor.read(i)}")
|
||||||
|
print("")
|
||||||
|
time.sleep(0.2)
|
||||||
|
|
||||||
|
Motor Test
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
from compLib.Motor import Motor
|
||||||
|
from compLib.Encoder import Encoder
|
||||||
|
import time
|
||||||
|
|
||||||
|
Motor.power(1, -50)
|
||||||
|
Motor.power(4, 50)
|
||||||
|
|
||||||
|
while True:
|
||||||
|
print(f"L:{Encoder.read(4)} R:{Encoder.read(1)}")
|
||||||
|
time.sleep(0.1)
|
||||||
|
|
||||||
|
Servo Test
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
from compLib.Servo import Servo
|
||||||
|
import time
|
||||||
|
|
||||||
|
for i in range(1, 8 + 1):
|
||||||
|
Servo.set_position(i, 45)
|
||||||
|
print(f"{i}")
|
||||||
|
time.sleep(1)
|
||||||
|
|
||||||
|
Servo.setup_position()
|
||||||
|
time.sleep(10)
|
||||||
|
|
||||||
|
Vision Test
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
import cv2
|
||||||
|
from compLib import Vision
|
||||||
|
from compLib.Servo import Servo
|
||||||
|
|
||||||
|
while True:
|
||||||
|
frame = Vision.Streaming.get_frame()
|
||||||
|
Vision.Streaming.publish_frame(frame)
|
||||||
|
Servo.set_position(3, -45)
|
Reference in a new issue