motor test + qrdocs

This commit is contained in:
br committed 2024-01-11 21:54:21 +01:00
1 parent 675d050581
commit 2d7ec8c2fb
5 files changed
+96 -4

No files matched your search

+24
View File
@@ -11,3 +11,27 @@ Bau eines Hausaufgaben Robos
* Repo für die Web-App, um den Vokabeltester / Mathe-Checker zu starten. * Repo für die Web-App, um den Vokabeltester / Mathe-Checker zu starten.
## Links ## Links
## Configs
Das Unit file für einen quiz Service (auf Gunicorn Basis)
* vi /etc/systemd/system/quiz.service
~~~
[Unit]
Description=Gunicorn instance to serve quiz
After=network.target
[Service]
User=kico
Group=www-data
WorkingDirectory=/home/kico/git/robotik-wise23/quiz
#Environment="PATH=/home/sammy/myproject/myprojectenv/bin"
#ExecStart=/home/sammy/myproject/myprojectenv/bin/gunicorn --workers 3 --bind unix:myproject.sock -m 007 wsgi:app
ExecStart=/usr/bin/gunicorn --workers 1 --bind 0.0.0.0:8000 quiz:app
[Install]
WantedBy=multi-user.target
~~~
+63
View File
@@ -0,0 +1,63 @@
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
coil_A_1_pin = 24 # pink
coil_A_2_pin = 4 # orange
coil_B_1_pin = 23 # blau
coil_B_2_pin = 25 # gelb
coil2_A_1_pin = 18 # pink
coil2_A_2_pin = 22 # orange
coil2_B_1_pin = 17 # blau
coil2_B_2_pin = 27 # gelb
StepCount = 8
Seq = list(range(0, StepCount))
Seq[0] = [0,1,0,0]
Seq[1] = [0,1,0,1]
Seq[2] = [0,0,0,1]
Seq[3] = [1,0,0,1]
Seq[4] = [1,0,0,0]
Seq[5] = [1,0,1,0]
Seq[6] = [0,0,1,0]
Seq[7] = [0,1,1,0]
GPIO.setup(coil_A_1_pin, GPIO.OUT)
GPIO.setup(coil_A_2_pin, GPIO.OUT)
GPIO.setup(coil_B_1_pin, GPIO.OUT)
GPIO.setup(coil_B_2_pin, GPIO.OUT)
GPIO.setup(coil2_A_1_pin, GPIO.OUT)
GPIO.setup(coil2_A_2_pin, GPIO.OUT)
GPIO.setup(coil2_B_1_pin, GPIO.OUT)
GPIO.setup(coil2_B_2_pin, GPIO.OUT)
def setStep(w1, w2, w3, w4):
GPIO.output(coil_A_1_pin, w1)
GPIO.output(coil2_A_1_pin, w1)
GPIO.output(coil_A_2_pin, w2)
GPIO.output(coil2_A_2_pin, w2)
GPIO.output(coil_B_1_pin, w3)
GPIO.output(coil2_B_1_pin, w3)
GPIO.output(coil_B_2_pin, w4)
GPIO.output(coil2_B_2_pin, w4)
def forward(delay, steps):
for i in range(steps):
for j in range(StepCount):
setStep(Seq[j][0], Seq[j][1], Seq[j][2], Seq[j][3])
time.sleep(delay)
def backwards(delay, steps):
for i in range(steps):
for j in reversed(range(StepCount)):
setStep(Seq[j][0], Seq[j][1], Seq[j][2], Seq[j][3])
time.sleep(delay)
# 20 langsame Schritte Vorwärts
delay = 20
steps = 20
forward(int(delay) / 1000.0, int(steps))
# 200 schnelle Schritte Rückwärts
delay = 1
steps = 200
backwards(int(delay) / 1000.0, int(steps))
+1 -1
View File
@@ -27,7 +27,7 @@
% Kopf- und Fußzeilen % Kopf- und Fußzeilen
\pagestyle{fancy} \pagestyle{fancy}
\fancyhf{} \fancyhf{}
\rhead{\includegraphics[width=3cm]{logo.png}} % Logo einfügen % \rhead{\includegraphics[width=3cm]{logo.png}} % Logo einfügen
\lhead{\textcolor{HeaderColor}{\Large IQ-O-Mat}} \lhead{\textcolor{HeaderColor}{\Large IQ-O-Mat}}
\lfoot{\textcolor{TextColor}{Kinder-College}} \lfoot{\textcolor{TextColor}{Kinder-College}}
\rfoot{\thepage} \rfoot{\thepage}
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

+8 -3
View File
@@ -3,6 +3,7 @@ ABLAGEDIR=~/Robotik-Ablage
PDFDIR=$ABLAGEDIR/pdfs PDFDIR=$ABLAGEDIR/pdfs
mkdir -p $PDFDIR mkdir -p $PDFDIR
for i in {01..39} for i in {01..39}
#for i in {01..02}
do do
cat <<EOF > $PDFDIR/kicopi$i.md cat <<EOF > $PDFDIR/kicopi$i.md
--- ---
@@ -10,7 +11,6 @@ title: "IQ-O-Mat"
author: "Kinder-College Björn Runden <br@runden.de>" author: "Kinder-College Björn Runden <br@runden.de>"
date: "2024-01-13" date: "2024-01-13"
--- ---
## Quiz-Roboter ## Quiz-Roboter
*Entstanden am Kinder-College als "Hausaufgaben-Robo"* *Entstanden am Kinder-College als "Hausaufgaben-Robo"*
@@ -26,8 +26,13 @@ Oder dem Link im QR Code folgen:
\\qrcode[height=6cm]{http://kicopi$i.local/} \\qrcode[height=6cm]{http://kicopi$i.local/}
\\end{figure} \\end{figure}
Gruß *Anmerkungen:* (WLAN am Raspberry einschalten:)
Jakob Holderbaum, Ulf Borcherdt, Björn Runden
* https://www.elektronik-kompendium.de/sites/raspberry-pi/1912221.htm
* https://www.raspberry-pi-geek.de/ausgaben/rpg/2017/10/ssh-und-wlan-schon-bei-der-installation-konfigurieren/
Der Raspberry kann daheim per LAN Kabel betrieben werden. Danach mittels raspi-config in's heimische WLAN eingebunden werden.
Der Raspberry kann per HDMI am Monitor oder TV betrieben werden. Mit (USB-) Maus und Tastatur lässt er sich ins WLAN einbinden.
EOF EOF
pandoc $PDFDIR/kicopi$i.md -o $PDFDIR/kicopi$i.pdf --template default.latex pandoc $PDFDIR/kicopi$i.md -o $PDFDIR/kicopi$i.pdf --template default.latex