diff --git a/README.md b/README.md index b39c29b..1c03f84 100644 --- a/README.md +++ b/README.md @@ -11,3 +11,27 @@ Bau eines Hausaufgaben Robos * Repo für die Web-App, um den Vokabeltester / Mathe-Checker zu starten. ## 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 +~~~ + diff --git a/beginner/gpio-moto2-test.py b/beginner/gpio-moto2-test.py new file mode 100644 index 0000000..6e004ee --- /dev/null +++ b/beginner/gpio-moto2-test.py @@ -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)) \ No newline at end of file diff --git a/qr-docs/default.latex b/qr-docs/default.latex index 043a73e..e56345e 100644 --- a/qr-docs/default.latex +++ b/qr-docs/default.latex @@ -27,7 +27,7 @@ % Kopf- und Fußzeilen \pagestyle{fancy} \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}} \lfoot{\textcolor{TextColor}{Kinder-College}} \rfoot{\thepage} diff --git a/qr-docs/logo.png b/qr-docs/logo.png new file mode 100644 index 0000000..9cb5134 Binary files /dev/null and b/qr-docs/logo.png differ diff --git a/qr-docs/loop-files.sh b/qr-docs/loop-files.sh index 1826e31..bac9f99 100755 --- a/qr-docs/loop-files.sh +++ b/qr-docs/loop-files.sh @@ -3,6 +3,7 @@ ABLAGEDIR=~/Robotik-Ablage PDFDIR=$ABLAGEDIR/pdfs mkdir -p $PDFDIR for i in {01..39} +#for i in {01..02} do cat < $PDFDIR/kicopi$i.md --- @@ -10,7 +11,6 @@ title: "IQ-O-Mat" author: "Kinder-College Björn Runden " date: "2024-01-13" --- - ## Quiz-Roboter *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/} \\end{figure} -Gruß -Jakob Holderbaum, Ulf Borcherdt, Björn Runden +*Anmerkungen:* (WLAN am Raspberry einschalten:) + +* 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 pandoc $PDFDIR/kicopi$i.md -o $PDFDIR/kicopi$i.pdf --template default.latex