Added livehtml

This commit is contained in:
Ithamar Herrewijnen 2023-08-25 19:35:45 +02:00
parent 939b681239
commit 0f2b79572f
49 changed files with 1499 additions and 14484 deletions

167
J1P2/escaperoom_code Normal file
View File

@ -0,0 +1,167 @@
#include <stdint.h>
#include <stddef.h>
#include <string.h>
#include <HardwareSerial.h>
#include <FastLED.h>
#include <Wire.h> // Library for I2C communication
#include <LiquidCrystal_I2C.h>
#include <Arduino.h>
#include <FastLED.h>
#define BTN_1 2
#define BTN_2 3
#define BTN_3 4
#define BTN_4 5
#define BTN_5 6
#define BTN_CHECK 7
#define DATA_PIN 8
#define NUM_LEDS 5
LiquidCrystal_I2C lcd = LiquidCrystal_I2C(0x27, 16, 2);
void greet_screen()
{
lcd.setCursor(2, 0); // Set the cursor on the third column and first row.
lcd.print("Escaperoom J1P2"); // Print the string "Hello World!"
lcd.setCursor(2, 1); // Set the cursor on the third column and the second row (counting starts at 0!).
lcd.print(" Led puzzle");
lcd.setCursor(2, 2);
lcd.print("by blonde");
}
void winner_screen()
{
lcd.setCursor(2, 0);
lcd.print("Congratulations!");
}
CRGB leds[NUM_LEDS];
int pw_state[NUM_LEDS] = {0, 0, 0, 0, 0};
int correct_pw[NUM_LEDS] = {1, 1, 1, 1, 1};
void generate_password()
{
for(int i = 0; i < NUM_LEDS; i++){
correct_pw[i] = random(0, 5);
}
}
void set_led_color(int led, int value){
switch (value)
{
case 0:
leds[led] = CRGB::Blue;
break;
case 1:
leds[led] = CRGB::Orange;
break;
case 2:
leds[led] = CRGB::Red;
break;
case 3:
leds[led] = CRGB::Yellow;
break;
case 4:
leds[led] = CRGB::Green;
break;
default:
break;
}
}
void sync_colors(){
for(int i = 0; i < NUM_LEDS; i++){
set_led_color(i, pw_state[i]);
}
FastLED.show();
}
bool check_pw(){
// Will return False if any led is wrong.
for(int i = 0; i < NUM_LEDS; i++){
if(correct_pw[i] != pw_state[i]){
return false;
}
}
// At this point all leds are correct!
return true;
}
int count_wrong_leds() {
int ret = 0;
for(int i = 0; i < NUM_LEDS; i++){
if(correct_pw[i] != pw_state[i]){
ret = ret + 1;
}
}
return ret;
}
void fout_leds() {
int ret = count_wrong_leds();
lcd.clear();
lcd.setCursor(2, 0);
lcd.print(String("leds correct "));
lcd.setCursor(3,1);
lcd.print(String(NUM_LEDS - ret));
}
void setup()
{
// Setup Serial monitor
Serial.begin(9600);
// Init LCD
lcd.init();
lcd.backlight();
greet_screen();
// Init Ledstrip
FastLED.setBrightness(255);
FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
// FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
// Setup buttons
pinMode(BTN_1, INPUT_PULLUP);
pinMode(BTN_2, INPUT_PULLUP);
pinMode(BTN_3, INPUT_PULLUP);
pinMode(BTN_4, INPUT_PULLUP);
pinMode(BTN_5, INPUT_PULLUP);
pinMode(BTN_CHECK, INPUT_PULLUP);
fill_solid(leds, NUM_LEDS, CRGB::Black);
FastLED.show();
generate_password();
}
void loop()
{
// Get value of each button and do something if the button is pressed
int start = 2;
for(int i = 0; i < NUM_LEDS; i++){
int val = digitalRead(start + i);
if(val == 0 ){
pw_state[i] = pw_state[i] + 1;
// Value can't be higher than 4
if(pw_state[i] > 4){
pw_state[i] = 0;
}
delay(100);
}
}
sync_colors();
// Check password if check button is pressed
if(digitalRead(BTN_CHECK) == 0){
if(check_pw() == true){
winner_screen();
}
else {
fout_leds();
}
}
delay(1);
}

View File

@ -7,6 +7,10 @@ SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build
SPHINXAUTOBUILD = sphinx-autobuild
livehtml:
@$(SPHINXAUTOBUILD) -b html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS)
# Put it first so that "make" without argument is like "make help".
help:
@ -17,4 +21,4 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

Binary file not shown.

View File

@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: a5515a6cd53f0d2a1fdff39f937866af
config: d46b0678c8f738d7c9c9f1776b28e194
tags: 645f666f9bcd5a90fca523b33c5a78b7

View File

@ -0,0 +1,74 @@
<mxfile host="65bd71144e">
<diagram id="C5RBs43oDa-KdzZeNtuy" name="Page-1">
<mxGraphModel dx="1204" dy="788" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-0"/>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-1" parent="WIyWlLk6GJQsqaUBKTNV-0"/>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-2" value="" style="rounded=0;html=1;jettySize=auto;orthogonalLoop=1;fontSize=11;endArrow=block;endFill=0;endSize=8;strokeWidth=1;shadow=0;labelBackgroundColor=none;edgeStyle=orthogonalEdgeStyle;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="WIyWlLk6GJQsqaUBKTNV-3" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="220" y="170" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-3" value="Nano is inactive" style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="160" y="80" width="120" height="40" as="geometry"/>
</mxCell>
<mxCell id="cu5jRHnhM64dbvBLo5j4-2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="cu5jRHnhM64dbvBLo5j4-0" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="220" y="270" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="cu5jRHnhM64dbvBLo5j4-0" value="User presses led button" style="rounded=0;whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="160" y="150" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="cu5jRHnhM64dbvBLo5j4-5" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="cu5jRHnhM64dbvBLo5j4-3" target="cu5jRHnhM64dbvBLo5j4-4" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="cu5jRHnhM64dbvBLo5j4-3" value="button status changes&lt;br&gt;counter changes to &lt;br&gt;next value" style="rounded=0;whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="160" y="240" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="cu5jRHnhM64dbvBLo5j4-7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="cu5jRHnhM64dbvBLo5j4-4" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="220" y="450" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="cu5jRHnhM64dbvBLo5j4-4" value="led changes color&lt;br&gt;based on counter value" style="rounded=0;whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="160" y="320" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="cu5jRHnhM64dbvBLo5j4-10" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="cu5jRHnhM64dbvBLo5j4-8" target="cu5jRHnhM64dbvBLo5j4-9" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="cu5jRHnhM64dbvBLo5j4-8" value="&lt;div&gt;User presses check &lt;br&gt;&lt;/div&gt;&lt;div&gt;button&lt;br&gt;&lt;/div&gt;" style="rounded=0;whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="160" y="400" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="cu5jRHnhM64dbvBLo5j4-16" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="cu5jRHnhM64dbvBLo5j4-9" target="cu5jRHnhM64dbvBLo5j4-15" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="cu5jRHnhM64dbvBLo5j4-20" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="cu5jRHnhM64dbvBLo5j4-9" target="cu5jRHnhM64dbvBLo5j4-19" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="cu5jRHnhM64dbvBLo5j4-9" value="&lt;div&gt;Are the colors&lt;/div&gt;&lt;div&gt;Correct?&lt;/div&gt;" style="rhombus;whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="170" y="470" width="100" height="100" as="geometry"/>
</mxCell>
<mxCell id="cu5jRHnhM64dbvBLo5j4-17" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="cu5jRHnhM64dbvBLo5j4-15" target="cu5jRHnhM64dbvBLo5j4-0" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="410" y="180"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="cu5jRHnhM64dbvBLo5j4-15" value="&lt;div&gt;Display correct &lt;br&gt;&lt;/div&gt;&lt;div&gt;amount of leds&lt;br&gt;&lt;/div&gt;" style="whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="340" y="490" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="cu5jRHnhM64dbvBLo5j4-18" value="NO" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="270" y="490" width="60" height="30" as="geometry"/>
</mxCell>
<mxCell id="cu5jRHnhM64dbvBLo5j4-19" value="Congrats, play jingle" style="rounded=1;whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry y="490" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="cu5jRHnhM64dbvBLo5j4-21" value="yes" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="120" y="490" width="60" height="30" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 KiB

View File

@ -1,7 +1,6 @@
****************
Ithamar's Agenda
****************
Tabel van opdrachten
@ -11,29 +10,18 @@ Tabel van opdrachten
|| || || || |
|| || || || |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+--------+
| verslag arduino bluetooth | 24 december | kan digitaal worden opgestuurd | |
| HerExamen 2 SQLite | ????? | lees dit keer iets meer door | |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+--------+
| Opdracht 21: Sensor uitlezen met Ardutooth | 24 december | moet worden gepresenteerd | |
| Nederlands her-Examen 3 | ???? | | |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+--------+
| Elevator pitch zelfreflectie verslag | 23 november | Inleveren via teams | |
| Stage + opdracht | januari | moet voor periode 3 januri geregeld zijn | |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+--------+
| Opdracht 22: Onderzoek Security wireless comm. | 24 december | moet worden gepresenteerd | |
| Afstudeerstage + opdracht | 20 januari | vereist voor het cijfer van SQLite | |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+--------+
| Opdracht 23 IR control | 24 december | moet worden gepresenteerd | |
| Keuzevak voor jaar 2 | 2023-2024 | opmaak voor gefaald zorgrobot, japans misschien? | |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+--------+
| Opdracht 24a - b Ventilator met 433mhz | 24 december | moet worden gepresenteerd | |
| Haal firebeetle op van paul | 4 september 2023 - 28 juli 2024 | uitleensel | |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+--------+
| Opdracht 25 - tempverloop op SD (thuis) | 24 december | moet worden gepresenteerd | |
| Fnaf movie october | 27 october | Groep/solo uitje | |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+--------+
| Opdracht 27 - ESP8266 - webserver | 24 december | moet worden gepresenteerd | |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+--------+
| Opdracht 28 - ESP8266 - client - data-analyse. | 24 december | moet worden gepresenteerd | |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+--------+
| python 2 rgb ledstrip opdracht 2 | 10 december | moet worden gepresenteerd | |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+--------+
| Cisco week opdrachten | 24 december | alle opdrachten moeten gezipt worden ingeleverd aan het einde van de periode | |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+--------+
| workshop escaperoom | 18 januari 2023 | de escaperoom moet worden verwerkt in een presentatie tijdens te toetsweek | |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+--------+

View File

@ -9,6 +9,24 @@ moet gemaakt worden via de kennis die is opgedaan met de opdrachten van de werkp
Het groepje waarbij ik zit heeft als thema: horror, ondanks dit theme is de echte horror een doos vinden om de escaperoom uit te maken
en op tijd de puzzles te maken en te kunnen verwerken in deze doos.
De puzzel die ik wil maken is afgeleid van de ::ref:`https://www.youtube.com/watch?v=VaPQGiTq8Bc<oneshot color puzzle>'
De puzzel die ik wil maken is afgeleid van de `oneshot color puzzle <https://www.youtube.com/watch?v=VaPQGiTq8Bc>`_
.. image:: escape_room/design.png
Bij de eerste sketch waren RGB leds gekozen om de lampjes te representeren, maar om kabels te besparen zullen we dit vervangen met leds van een
WS2812B. Hiervoor is een simpele sketch gemaakt om vanaf te werken.
.. image:: escape_room/nwsketch.png
8 december: de puzzel is fysiek compleet maar moet nog geprogrammeerd worden en de bekabeling gecontroleerd, zodra dit gedeelte klaar is zijn er
nog 2 mogelijke problemen met het gehele project: de puzzel naar puzzel communicatie en de intergratie van in de escapedoos.
.. image:: escape_room/nanobuild.jpg
11 december: De puzzel is nog in productie maar het finale product is besloten, om het concept van de puzzel over te brengen heb ik ook een flowchart
gemaakt om het process uit te leggen
.. image:: escape_room/flowchart.drawio
27 januari: De puzzel is in hout gezet voor de presentatie, helaas was bij de decoratie de opbouw van de puzzel niet in consideratie genomen. Hierdoor is de originele
decoratie niet gebruikt in het eindproduct.

View File

@ -12,4 +12,5 @@ Welcome to Ithamar's AD's documentation!
agenda.rst
cijfers.rst
escape_room.rst
escape_room.rst
pico.rst

View File

@ -0,0 +1,37 @@
Arduino pico
=============
This is where the pico ledstrip projects are store, for a bit of context: for year 1 period 2 i am tasked with working with the arduino pico and a ledstrip (w2812B).
This project mostly revolves around making the ledstrip light up certain lights and patterns, the fundamental lesson that the school is trying to teach us is
learning to work with loops and statements. Through these projects we will be required to rely less on simple inputs and imports and more on thinking out of the box.
The files refferenced can be found in https://git.herreweb.nl/IthamarHerrewijnen/Ithamar_code/src/branch/main/documentation/source or the git repository.
Apart from micropython no other packages have to be installed.
Notable files
Colorwave: This is one of the files required to work with the ledstrip. It defines colors for easier use and can be used as a test file to see if a strip works or not.
.. collapse:: Notes
This code contains a lot of callable intergers, it also gives the fucntion to the ledstrip to move from left to right.
NeoPixel: this file actually programs directly into the ledstrip rather than give it some intergers. This file is required to operate the ledstrip to begin with.
therefore it is a rather large file with a full documentation on `github <https://github.com/adafruit/Adafruit_NeoPixel>`_.
.. collapse:: notes
This code contains all the technical functions of the ledstrip setup. The interesting part for the user are functinos such as "brightness", "show" and "rotate". Whereas
colorwave gave the user the colors for the ledstrip, Neopixel gives the user all the fun functions to create your own custom lighting.
discolight_sl: This is the main file i'm currently using to stash all my functions in. For the moment this only includes some code i got from some `guy <https://git.herreweb.nl/EljakimHerrewijnen>`_
called disco. My own code which is called police and a shutoff function. Because i'm too lazy to scroll for the functions i call them in a different file.
.. collapse:: Notes
This code has very few interesting notes, In the function: "discolight" we use a randomizer to set every pixel to some random rgb value. In the function :"police"
we use a clever calculation to get the even numbers for one set of leds and the very same formula to get the uneven leds. After that we simply make the leds take turns
in who gets to light up first, creating a policelight effect.
This code is a work in progress and will be continued in due time.

View File

@ -1,35 +0,0 @@
****************
Ithamar's Agenda
****************
Tabel van opdrachten
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+
| Wat | Wanneer | Opmerking |
+================================================+=================+==============================================================================+
|| verslag arduino bluetooth || 24 december || kan digitaal worden opgestuurd |
|| Opdracht 14: afstandsmeter met leds || ASAP rdm || moet worden gepresenteerd |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+
| Opdracht 21: Sensor uitlezen met Ardutooth | 24 december | moet worden gepresenteerd |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+
| Opdracht 22: Onderzoek Security wireless comm. | 24 december | moet worden gepresenteerd |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+
| Opdracht 23 IR control | 24 december | moet worden gepresenteerd |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+
| Opdracht 24a - b Ventilator met 433mhz | 24 december | moet worden gepresenteerd |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+
| Opdracht 25 - tempverloop op SD (thuis) | 24 december | moet worden gepresenteerd |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+
| Opdracht 27 - ESP8266 - webserver | 24 december | moet worden gepresenteerd |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+
| Opdracht 28 - ESP8266 - client - data-analyse. | 24 december | moet worden gepresenteerd |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+
| python 2 rgb ledstrip opdracth 2 | 10 december | moet worden gepresenteerd |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+
| Cisco week opdrachten | 24 december | alle opdrachten moeten gezipt worden ingeleverd aan het einde van de periode |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+
| workshop escaperoom | 18 januari 2023 | de escaperoom moet worden verwerkt in een presentatie tijdens te toetsweek |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+

View File

@ -1,607 +0,0 @@
@import url("basic.css");
/* -- page layout ----------------------------------------------------------- */
body {
font-family: 'goudy old style', 'minion pro', 'bell mt', Georgia, 'Hiragino Mincho Pro', serif;
font-size: 17px;
background-color: white;
color: #000;
margin: 0;
padding: 0;
}
div.document {
width: 940px;
margin: 30px auto 0 auto;
}
div.documentwrapper {
float: left;
width: 100%;
}
div.bodywrapper {
margin: 0 0 0 220px;
}
div.sphinxsidebar {
width: 220px;
font-size: 14px;
line-height: 1.5;
}
hr {
border: 1px solid #B1B4B6;
}
div.body {
background-color: #ffffff;
color: #3E4349;
padding: 0 30px 0 30px;
}
div.body > .section {
text-align: left;
}
div.footer {
width: 940px;
margin: 20px auto 30px auto;
font-size: 14px;
color: #888;
text-align: right;
}
div.footer a {
color: #888;
}
p.caption {
font-family: ;
font-size: inherit;
}
div.relations {
display: none;
}
div.sphinxsidebar a {
color: #444;
text-decoration: none;
border-bottom: 1px dotted #999;
}
div.sphinxsidebar a:hover {
border-bottom: 1px solid #999;
}
div.sphinxsidebarwrapper {
padding: 18px 10px;
}
div.sphinxsidebarwrapper p.logo {
padding: 0;
margin: -10px 0 0 0px;
text-align: center;
}
div.sphinxsidebarwrapper h1.logo {
margin-top: -10px;
text-align: center;
margin-bottom: 5px;
text-align: left;
}
div.sphinxsidebarwrapper h1.logo-name {
margin-top: 0px;
}
div.sphinxsidebarwrapper p.blurb {
margin-top: 0;
font-style: normal;
}
div.sphinxsidebar h3,
div.sphinxsidebar h4 {
font-family: 'Garamond', 'Georgia', serif;
color: #444;
font-size: 24px;
font-weight: normal;
margin: 0 0 5px 0;
padding: 0;
}
div.sphinxsidebar h4 {
font-size: 20px;
}
div.sphinxsidebar h3 a {
color: #444;
}
div.sphinxsidebar p.logo a,
div.sphinxsidebar h3 a,
div.sphinxsidebar p.logo a:hover,
div.sphinxsidebar h3 a:hover {
border: none;
}
div.sphinxsidebar p {
color: #555;
margin: 10px 0;
}
div.sphinxsidebar ul {
margin: 10px 0;
padding: 0;
color: #000;
}
div.sphinxsidebar ul li.toctree-l1 > a {
font-size: 120%;
}
div.sphinxsidebar ul li.toctree-l2 > a {
font-size: 110%;
}
div.sphinxsidebar input {
border: 1px solid #CCC;
font-family: 'goudy old style', 'minion pro', 'bell mt', Georgia, 'Hiragino Mincho Pro', serif;
font-size: 1em;
}
div.sphinxsidebar hr {
border: none;
height: 1px;
color: #AAA;
background: #AAA;
text-align: left;
margin-left: 0;
width: 50%;
}
/* -- body styles ----------------------------------------------------------- */
a {
color: #004B6B;
text-decoration: underline;
}
a:hover {
color: #6D4100;
text-decoration: underline;
}
div.body h1,
div.body h2,
div.body h3,
div.body h4,
div.body h5,
div.body h6 {
font-family: 'Garamond', 'Georgia', serif;
font-weight: normal;
margin: 30px 0px 10px 0px;
padding: 0;
}
div.body h1 { margin-top: 0; padding-top: 0; font-size: 240%; }
div.body h2 { font-size: 180%; }
div.body h3 { font-size: 150%; }
div.body h4 { font-size: 130%; }
div.body h5 { font-size: 100%; }
div.body h6 { font-size: 100%; }
a.headerlink {
color: #DDD;
padding: 0 4px;
text-decoration: none;
}
a.headerlink:hover {
color: #444;
background: #EAEAEA;
}
div.body p, div.body dd, div.body li {
line-height: 1.4em;
}
div.admonition {
margin: 20px 0px;
padding: 10px 30px;
background-color: #FCC;
border: 1px solid #FAA;
}
div.admonition tt.xref, div.admonition a tt {
border-bottom: 1px solid #fafafa;
}
dd div.admonition {
margin-left: -60px;
padding-left: 60px;
}
div.admonition p.admonition-title {
font-family: 'Garamond', 'Georgia', serif;
font-weight: normal;
font-size: 24px;
margin: 0 0 10px 0;
padding: 0;
line-height: 1;
}
div.admonition p.last {
margin-bottom: 0;
}
div.highlight {
background-color: white;
}
dt:target, .highlight {
background: #FAF3E8;
}
div.note {
background-color: #EEE;
border: 1px solid #CCC;
}
div.seealso {
background-color: #EEE;
border: 1px solid #CCC;
}
div.topic {
background-color: #eee;
}
p.admonition-title {
display: inline;
}
p.admonition-title:after {
content: ":";
}
pre, tt, code {
font-family: 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
font-size: 0.9em;
}
.hll {
background-color: #FFC;
margin: 0 -12px;
padding: 0 12px;
display: block;
}
img.screenshot {
}
tt.descname, tt.descclassname, code.descname, code.descclassname {
font-size: 0.95em;
}
tt.descname, code.descname {
padding-right: 0.08em;
}
img.screenshot {
-moz-box-shadow: 2px 2px 4px #eee;
-webkit-box-shadow: 2px 2px 4px #eee;
box-shadow: 2px 2px 4px #eee;
}
table.docutils {
border: 1px solid #888;
-moz-box-shadow: 2px 2px 4px #eee;
-webkit-box-shadow: 2px 2px 4px #eee;
box-shadow: 2px 2px 4px #eee;
}
table.docutils td, table.docutils th {
border: 1px solid #888;
padding: 0.25em 0.7em;
}
table.field-list, table.footnote {
border: none;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
table.footnote {
margin: 15px 0;
width: 100%;
border: 1px solid #EEE;
background: #FDFDFD;
font-size: 0.9em;
}
table.footnote + table.footnote {
margin-top: -15px;
border-top: none;
}
table.field-list th {
padding: 0 0.8em 0 0;
}
table.field-list td {
padding: 0;
}
table.field-list p {
margin-bottom: 0.8em;
}
table.footnote td.label {
width: .1px;
padding: 0.3em 0 0.3em 0.5em;
}
table.footnote td {
padding: 0.3em 0.5em;
}
dl {
margin: 0;
padding: 0;
}
dl dd {
margin-left: 30px;
}
blockquote {
margin: 0 0 0 30px;
padding: 0;
}
ul, ol {
/* Matches the 30px from the narrow-screen "li > ul" selector below */
margin: 10px 0 10px 30px;
padding: 0;
}
pre {
background: #EEE;
padding: 7px 30px;
margin: 15px 0px;
line-height: 1.3em;
}
dl pre, blockquote pre, li pre {
margin-left: 0;
padding-left: 30px;
}
dl dl pre {
margin-left: -90px;
padding-left: 90px;
}
tt, code {
background-color: #ecf0f3;
color: #222;
/* padding: 1px 2px; */
}
tt.xref, code.xref, a tt {
background-color: #FBFBFB;
border-bottom: 1px solid white;
}
a.reference {
text-decoration: none;
border-bottom: 1px dotted #004B6B;
}
/* Don't put an underline on images */
a.image-reference, a.image-reference:hover {
border-bottom: none;
}
a.reference:hover {
border-bottom: 1px solid #6D4100;
}
a.footnote-reference {
text-decoration: none;
font-size: 0.7em;
vertical-align: top;
border-bottom: 1px dotted #004B6B;
}
a.footnote-reference:hover {
border-bottom: 1px solid #6D4100;
}
a:hover tt, a:hover code {
background: #EEE;
}
@media screen and (max-width: 870px) {
div.sphinxsidebar {
display: none;
}
div.document {
width: 100%;
}
div.documentwrapper {
margin-left: 0;
margin-top: 0;
margin-right: 0;
margin-bottom: 0;
}
div.bodywrapper {
margin-top: 0;
margin-right: 0;
margin-bottom: 0;
margin-left: 0;
}
ul {
margin-left: 0;
}
li > ul {
/* Matches the 30px from the "ul, ol" selector above */
margin-left: 30px;
}
.document {
width: auto;
}
.footer {
width: auto;
}
.bodywrapper {
margin: 0;
}
.footer {
width: auto;
}
.github {
display: none;
}
}
@media screen and (max-width: 875px) {
body {
margin: 0;
padding: 20px 30px;
}
div.documentwrapper {
float: none;
background: white;
}
div.sphinxsidebar {
display: block;
float: none;
width: 102.5%;
margin: 50px -30px -20px -30px;
padding: 10px 20px;
background: #333;
color: #FFF;
}
div.sphinxsidebar h3, div.sphinxsidebar h4, div.sphinxsidebar p,
div.sphinxsidebar h3 a {
color: white;
}
div.sphinxsidebar a {
color: #AAA;
}
div.sphinxsidebar p.logo {
display: none;
}
div.document {
width: 100%;
margin: 0;
}
div.footer {
display: none;
}
div.bodywrapper {
margin: 0;
}
div.body {
min-height: 0;
padding: 0;
}
.rtd_doc_footer {
display: none;
}
.document {
width: auto;
}
.footer {
width: auto;
}
.footer {
width: auto;
}
.github {
display: none;
}
}
/* misc. */
.revsys-inline {
display: none!important;
}
/* Make nested-list/multi-paragraph items look better in Releases changelog
* pages. Without this, docutils' magical list fuckery causes inconsistent
* formatting between different release sub-lists.
*/
div#changelog > div.section > ul > li > p:only-child {
margin-bottom: 0;
}
/* Hide fugly table cell borders in ..bibliography:: directive output */
table.docutils.citation, table.docutils.citation td, table.docutils.citation th {
border: none;
/* Below needed in some edge cases; if not applied, bottom shadows appear */
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}

View File

@ -4,7 +4,7 @@
*
* Sphinx stylesheet -- basic theme.
*
* :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
@ -222,7 +222,7 @@ table.modindextable td {
/* -- general body styles --------------------------------------------------- */
div.body {
min-width: 450px;
min-width: 360px;
max-width: 800px;
}
@ -236,7 +236,6 @@ div.body p, div.body dd, div.body li, div.body blockquote {
a.headerlink {
visibility: hidden;
}
a.brackets:before,
span.brackets > a:before{
content: "[";
@ -247,6 +246,7 @@ span.brackets > a:after {
content: "]";
}
h1:hover > a.headerlink,
h2:hover > a.headerlink,
h3:hover > a.headerlink,
@ -334,13 +334,11 @@ aside.sidebar {
p.sidebar-title {
font-weight: bold;
}
div.admonition, div.topic, blockquote {
clear: left;
}
/* -- topics ---------------------------------------------------------------- */
div.topic {
border: 1px solid #ccc;
padding: 7px;
@ -428,10 +426,6 @@ table.docutils td, table.docutils th {
border-bottom: 1px solid #aaa;
}
table.footnote td, table.footnote th {
border: 0 !important;
}
th {
text-align: left;
padding-right: 5px;
@ -614,7 +608,6 @@ ol.simple p,
ul.simple p {
margin-bottom: 0;
}
dl.footnote > dt,
dl.citation > dt {
float: left;
@ -643,11 +636,11 @@ dl.field-list > dt {
padding-left: 0.5em;
padding-right: 5px;
}
dl.field-list > dt:after {
content: ":";
}
dl.field-list > dd {
padding-left: 0.5em;
margin-top: 0em;
@ -757,6 +750,7 @@ span.pre {
-ms-hyphens: none;
-webkit-hyphens: none;
hyphens: none;
white-space: nowrap;
}
div[class*="highlight-"] {

View File

@ -1,27 +0,0 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
project = "Ithamar's AD"
copyright = '2022, Ithamar'
author = 'Ithamar'
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
extensions = []
templates_path = ['_templates']
exclude_patterns = []
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
html_theme = 'sphinx_rtd_theme'
html_static_path = ['']

View File

@ -1 +0,0 @@
/* This file intentionally left blank. */

View File

@ -2,322 +2,155 @@
* doctools.js
* ~~~~~~~~~~~
*
* Sphinx JavaScript utilities for all documentation.
* Base JavaScript utilities for all Sphinx HTML documentation.
*
* :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
"use strict";
/**
* select a different prefix for underscore
*/
$u = _.noConflict();
const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([
"TEXTAREA",
"INPUT",
"SELECT",
"BUTTON",
]);
/**
* make the code below compatible with browsers without
* an installed firebug like debugger
if (!window.console || !console.firebug) {
var names = ["log", "debug", "info", "warn", "error", "assert", "dir",
"dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace",
"profile", "profileEnd"];
window.console = {};
for (var i = 0; i < names.length; ++i)
window.console[names[i]] = function() {};
}
*/
/**
* small helper function to urldecode strings
*
* See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL
*/
jQuery.urldecode = function(x) {
if (!x) {
return x
const _ready = (callback) => {
if (document.readyState !== "loading") {
callback();
} else {
document.addEventListener("DOMContentLoaded", callback);
}
return decodeURIComponent(x.replace(/\+/g, ' '));
};
/**
* small helper function to urlencode strings
*/
jQuery.urlencode = encodeURIComponent;
/**
* This function returns the parsed url parameters of the
* current request. Multiple values per key are supported,
* it will always return arrays of strings for the value parts.
*/
jQuery.getQueryParameters = function(s) {
if (typeof s === 'undefined')
s = document.location.search;
var parts = s.substr(s.indexOf('?') + 1).split('&');
var result = {};
for (var i = 0; i < parts.length; i++) {
var tmp = parts[i].split('=', 2);
var key = jQuery.urldecode(tmp[0]);
var value = jQuery.urldecode(tmp[1]);
if (key in result)
result[key].push(value);
else
result[key] = [value];
}
return result;
};
/**
* highlight a given string on a jquery object by wrapping it in
* span elements with the given class name.
*/
jQuery.fn.highlightText = function(text, className) {
function highlight(node, addItems) {
if (node.nodeType === 3) {
var val = node.nodeValue;
var pos = val.toLowerCase().indexOf(text);
if (pos >= 0 &&
!jQuery(node.parentNode).hasClass(className) &&
!jQuery(node.parentNode).hasClass("nohighlight")) {
var span;
var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg");
if (isInSVG) {
span = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
} else {
span = document.createElement("span");
span.className = className;
}
span.appendChild(document.createTextNode(val.substr(pos, text.length)));
node.parentNode.insertBefore(span, node.parentNode.insertBefore(
document.createTextNode(val.substr(pos + text.length)),
node.nextSibling));
node.nodeValue = val.substr(0, pos);
if (isInSVG) {
var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect");
var bbox = node.parentElement.getBBox();
rect.x.baseVal.value = bbox.x;
rect.y.baseVal.value = bbox.y;
rect.width.baseVal.value = bbox.width;
rect.height.baseVal.value = bbox.height;
rect.setAttribute('class', className);
addItems.push({
"parent": node.parentNode,
"target": rect});
}
}
}
else if (!jQuery(node).is("button, select, textarea")) {
jQuery.each(node.childNodes, function() {
highlight(this, addItems);
});
}
}
var addItems = [];
var result = this.each(function() {
highlight(this, addItems);
});
for (var i = 0; i < addItems.length; ++i) {
jQuery(addItems[i].parent).before(addItems[i].target);
}
return result;
};
/*
* backward compatibility for jQuery.browser
* This will be supported until firefox bug is fixed.
*/
if (!jQuery.browser) {
jQuery.uaMatch = function(ua) {
ua = ua.toLowerCase();
var match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
/(webkit)[ \/]([\w.]+)/.exec(ua) ||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
/(msie) ([\w.]+)/.exec(ua) ||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
[];
return {
browser: match[ 1 ] || "",
version: match[ 2 ] || "0"
};
};
jQuery.browser = {};
jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true;
}
/**
* Small JavaScript module for the documentation.
*/
var Documentation = {
init : function() {
this.fixFirefoxAnchorBug();
this.highlightSearchWords();
this.initIndexTable();
if (DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) {
this.initOnKeyListeners();
}
const Documentation = {
init: () => {
Documentation.initDomainIndexTable();
Documentation.initOnKeyListeners();
},
/**
* i18n support
*/
TRANSLATIONS : {},
PLURAL_EXPR : function(n) { return n === 1 ? 0 : 1; },
LOCALE : 'unknown',
TRANSLATIONS: {},
PLURAL_EXPR: (n) => (n === 1 ? 0 : 1),
LOCALE: "unknown",
// gettext and ngettext don't access this so that the functions
// can safely bound to a different name (_ = Documentation.gettext)
gettext : function(string) {
var translated = Documentation.TRANSLATIONS[string];
if (typeof translated === 'undefined')
return string;
return (typeof translated === 'string') ? translated : translated[0];
gettext: (string) => {
const translated = Documentation.TRANSLATIONS[string];
switch (typeof translated) {
case "undefined":
return string; // no translation
case "string":
return translated; // translation exists
default:
return translated[0]; // (singular, plural) translation tuple exists
}
},
ngettext : function(singular, plural, n) {
var translated = Documentation.TRANSLATIONS[singular];
if (typeof translated === 'undefined')
return (n == 1) ? singular : plural;
return translated[Documentation.PLURALEXPR(n)];
ngettext: (singular, plural, n) => {
const translated = Documentation.TRANSLATIONS[singular];
if (typeof translated !== "undefined")
return translated[Documentation.PLURAL_EXPR(n)];
return n === 1 ? singular : plural;
},
addTranslations : function(catalog) {
for (var key in catalog.messages)
this.TRANSLATIONS[key] = catalog.messages[key];
this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')');
this.LOCALE = catalog.locale;
addTranslations: (catalog) => {
Object.assign(Documentation.TRANSLATIONS, catalog.messages);
Documentation.PLURAL_EXPR = new Function(
"n",
`return (${catalog.plural_expr})`
);
Documentation.LOCALE = catalog.locale;
},
/**
* add context elements like header anchor links
* helper function to focus on search bar
*/
addContextElements : function() {
$('div[id] > :header:first').each(function() {
$('<a class="headerlink">\u00B6</a>').
attr('href', '#' + this.id).
attr('title', _('Permalink to this headline')).
appendTo(this);
});
$('dt[id]').each(function() {
$('<a class="headerlink">\u00B6</a>').
attr('href', '#' + this.id).
attr('title', _('Permalink to this definition')).
appendTo(this);
});
focusSearchBar: () => {
document.querySelectorAll("input[name=q]")[0]?.focus();
},
/**
* workaround a firefox stupidity
* see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075
* Initialise the domain index toggle buttons
*/
fixFirefoxAnchorBug : function() {
if (document.location.hash && $.browser.mozilla)
window.setTimeout(function() {
document.location.href += '';
}, 10);
},
/**
* highlight the search words provided in the url in the text
*/
highlightSearchWords : function() {
var params = $.getQueryParameters();
var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : [];
if (terms.length) {
var body = $('div.body');
if (!body.length) {
body = $('body');
initDomainIndexTable: () => {
const toggler = (el) => {
const idNumber = el.id.substr(7);
const toggledRows = document.querySelectorAll(`tr.cg-${idNumber}`);
if (el.src.substr(-9) === "minus.png") {
el.src = `${el.src.substr(0, el.src.length - 9)}plus.png`;
toggledRows.forEach((el) => (el.style.display = "none"));
} else {
el.src = `${el.src.substr(0, el.src.length - 8)}minus.png`;
toggledRows.forEach((el) => (el.style.display = ""));
}
window.setTimeout(function() {
$.each(terms, function() {
body.highlightText(this.toLowerCase(), 'highlighted');
});
}, 10);
$('<p class="highlight-link"><a href="javascript:Documentation.' +
'hideSearchWords()">' + _('Hide Search Matches') + '</a></p>')
.appendTo($('#searchbox'));
}
};
const togglerElements = document.querySelectorAll("img.toggler");
togglerElements.forEach((el) =>
el.addEventListener("click", (event) => toggler(event.currentTarget))
);
togglerElements.forEach((el) => (el.style.display = ""));
if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) togglerElements.forEach(toggler);
},
/**
* init the domain index toggle buttons
*/
initIndexTable : function() {
var togglers = $('img.toggler').click(function() {
var src = $(this).attr('src');
var idnum = $(this).attr('id').substr(7);
$('tr.cg-' + idnum).toggle();
if (src.substr(-9) === 'minus.png')
$(this).attr('src', src.substr(0, src.length-9) + 'plus.png');
else
$(this).attr('src', src.substr(0, src.length-8) + 'minus.png');
}).css('display', '');
if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) {
togglers.click();
}
},
initOnKeyListeners: () => {
// only install a listener if it is really needed
if (
!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS &&
!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS
)
return;
/**
* helper function to hide the search marks again
*/
hideSearchWords : function() {
$('#searchbox .highlight-link').fadeOut(300);
$('span.highlighted').removeClass('highlighted');
},
document.addEventListener("keydown", (event) => {
// bail for input elements
if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return;
// bail with special keys
if (event.altKey || event.ctrlKey || event.metaKey) return;
/**
* make the url absolute
*/
makeURL : function(relativeURL) {
return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL;
},
if (!event.shiftKey) {
switch (event.key) {
case "ArrowLeft":
if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break;
/**
* get the current relative url
*/
getCurrentURL : function() {
var path = document.location.pathname;
var parts = path.split(/\//);
$.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() {
if (this === '..')
parts.pop();
});
var url = parts.join('/');
return path.substring(url.lastIndexOf('/') + 1, path.length - 1);
},
initOnKeyListeners: function() {
$(document).keydown(function(event) {
var activeElementType = document.activeElement.tagName;
// don't navigate when in search box, textarea, dropdown or button
if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT'
&& activeElementType !== 'BUTTON' && !event.altKey && !event.ctrlKey && !event.metaKey
&& !event.shiftKey) {
switch (event.keyCode) {
case 37: // left
var prevHref = $('link[rel="prev"]').prop('href');
if (prevHref) {
window.location.href = prevHref;
return false;
const prevLink = document.querySelector('link[rel="prev"]');
if (prevLink && prevLink.href) {
window.location.href = prevLink.href;
event.preventDefault();
}
break;
case 39: // right
var nextHref = $('link[rel="next"]').prop('href');
if (nextHref) {
window.location.href = nextHref;
return false;
case "ArrowRight":
if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break;
const nextLink = document.querySelector('link[rel="next"]');
if (nextLink && nextLink.href) {
window.location.href = nextLink.href;
event.preventDefault();
}
break;
}
}
// some keyboard layouts may need Shift to get /
switch (event.key) {
case "/":
if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break;
Documentation.focusSearchBar();
event.preventDefault();
}
});
}
},
};
// quick alias for translations
_ = Documentation.gettext;
const _ = Documentation.gettext;
$(document).ready(function() {
Documentation.init();
});
_ready(Documentation.init);

View File

@ -1,12 +1,14 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '',
LANGUAGE: 'None',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
FILE_SUFFIX: '.html',
LINK_SUFFIX: '.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt',
NAVIGATION_WITH_KEYS: false
NAVIGATION_WITH_KEYS: false,
SHOW_SEARCH_SUMMARY: true,
ENABLE_SEARCH_SHORTCUTS: true,
};

View File

@ -1,22 +0,0 @@
.. Ithamar's AD documentation master file, created by
sphinx-quickstart on Sat Nov 19 21:09:44 2022.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to Ithamar's AD's documentation!
========================================
.. toctree::
:maxdepth: 2
:caption: Contents:
agenda.rst
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

File diff suppressed because one or more lines are too long

View File

@ -5,12 +5,12 @@
* This script contains the language-specific data used by searchtools.js,
* namely the list of stopwords, stemmer, scorer and splitter.
*
* :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
var stopwords = ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"];
var stopwords = ["a", "and", "are", "as", "at", "be", "but", "by", "for", "if", "in", "into", "is", "it", "near", "no", "not", "of", "on", "or", "such", "that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "with"];
/* Non-minified version is copied as a separate JS file, is available */
@ -197,101 +197,3 @@ var Stemmer = function() {
}
}
var splitChars = (function() {
var result = {};
var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648,
1748, 1809, 2416, 2473, 2481, 2526, 2601, 2609, 2612, 2615, 2653, 2702,
2706, 2729, 2737, 2740, 2857, 2865, 2868, 2910, 2928, 2948, 2961, 2971,
2973, 3085, 3089, 3113, 3124, 3213, 3217, 3241, 3252, 3295, 3341, 3345,
3369, 3506, 3516, 3633, 3715, 3721, 3736, 3744, 3748, 3750, 3756, 3761,
3781, 3912, 4239, 4347, 4681, 4695, 4697, 4745, 4785, 4799, 4801, 4823,
4881, 5760, 5901, 5997, 6313, 7405, 8024, 8026, 8028, 8030, 8117, 8125,
8133, 8181, 8468, 8485, 8487, 8489, 8494, 8527, 11311, 11359, 11687, 11695,
11703, 11711, 11719, 11727, 11735, 12448, 12539, 43010, 43014, 43019, 43587,
43696, 43713, 64286, 64297, 64311, 64317, 64319, 64322, 64325, 65141];
var i, j, start, end;
for (i = 0; i < singles.length; i++) {
result[singles[i]] = true;
}
var ranges = [[0, 47], [58, 64], [91, 94], [123, 169], [171, 177], [182, 184], [706, 709],
[722, 735], [741, 747], [751, 879], [888, 889], [894, 901], [1154, 1161],
[1318, 1328], [1367, 1368], [1370, 1376], [1416, 1487], [1515, 1519], [1523, 1568],
[1611, 1631], [1642, 1645], [1750, 1764], [1767, 1773], [1789, 1790], [1792, 1807],
[1840, 1868], [1958, 1968], [1970, 1983], [2027, 2035], [2038, 2041], [2043, 2047],
[2070, 2073], [2075, 2083], [2085, 2087], [2089, 2307], [2362, 2364], [2366, 2383],
[2385, 2391], [2402, 2405], [2419, 2424], [2432, 2436], [2445, 2446], [2449, 2450],
[2483, 2485], [2490, 2492], [2494, 2509], [2511, 2523], [2530, 2533], [2546, 2547],
[2554, 2564], [2571, 2574], [2577, 2578], [2618, 2648], [2655, 2661], [2672, 2673],
[2677, 2692], [2746, 2748], [2750, 2767], [2769, 2783], [2786, 2789], [2800, 2820],
[2829, 2830], [2833, 2834], [2874, 2876], [2878, 2907], [2914, 2917], [2930, 2946],
[2955, 2957], [2966, 2968], [2976, 2978], [2981, 2983], [2987, 2989], [3002, 3023],
[3025, 3045], [3059, 3076], [3130, 3132], [3134, 3159], [3162, 3167], [3170, 3173],
[3184, 3191], [3199, 3204], [3258, 3260], [3262, 3293], [3298, 3301], [3312, 3332],
[3386, 3388], [3390, 3423], [3426, 3429], [3446, 3449], [3456, 3460], [3479, 3481],
[3518, 3519], [3527, 3584], [3636, 3647], [3655, 3663], [3674, 3712], [3717, 3718],
[3723, 3724], [3726, 3731], [3752, 3753], [3764, 3772], [3774, 3775], [3783, 3791],
[3802, 3803], [3806, 3839], [3841, 3871], [3892, 3903], [3949, 3975], [3980, 4095],
[4139, 4158], [4170, 4175], [4182, 4185], [4190, 4192], [4194, 4196], [4199, 4205],
[4209, 4212], [4226, 4237], [4250, 4255], [4294, 4303], [4349, 4351], [4686, 4687],
[4702, 4703], [4750, 4751], [4790, 4791], [4806, 4807], [4886, 4887], [4955, 4968],
[4989, 4991], [5008, 5023], [5109, 5120], [5741, 5742], [5787, 5791], [5867, 5869],
[5873, 5887], [5906, 5919], [5938, 5951], [5970, 5983], [6001, 6015], [6068, 6102],
[6104, 6107], [6109, 6111], [6122, 6127], [6138, 6159], [6170, 6175], [6264, 6271],
[6315, 6319], [6390, 6399], [6429, 6469], [6510, 6511], [6517, 6527], [6572, 6592],
[6600, 6607], [6619, 6655], [6679, 6687], [6741, 6783], [6794, 6799], [6810, 6822],
[6824, 6916], [6964, 6980], [6988, 6991], [7002, 7042], [7073, 7085], [7098, 7167],
[7204, 7231], [7242, 7244], [7294, 7400], [7410, 7423], [7616, 7679], [7958, 7959],
[7966, 7967], [8006, 8007], [8014, 8015], [8062, 8063], [8127, 8129], [8141, 8143],
[8148, 8149], [8156, 8159], [8173, 8177], [8189, 8303], [8306, 8307], [8314, 8318],
[8330, 8335], [8341, 8449], [8451, 8454], [8456, 8457], [8470, 8472], [8478, 8483],
[8506, 8507], [8512, 8516], [8522, 8525], [8586, 9311], [9372, 9449], [9472, 10101],
[10132, 11263], [11493, 11498], [11503, 11516], [11518, 11519], [11558, 11567],
[11622, 11630], [11632, 11647], [11671, 11679], [11743, 11822], [11824, 12292],
[12296, 12320], [12330, 12336], [12342, 12343], [12349, 12352], [12439, 12444],
[12544, 12548], [12590, 12592], [12687, 12689], [12694, 12703], [12728, 12783],
[12800, 12831], [12842, 12880], [12896, 12927], [12938, 12976], [12992, 13311],
[19894, 19967], [40908, 40959], [42125, 42191], [42238, 42239], [42509, 42511],
[42540, 42559], [42592, 42593], [42607, 42622], [42648, 42655], [42736, 42774],
[42784, 42785], [42889, 42890], [42893, 43002], [43043, 43055], [43062, 43071],
[43124, 43137], [43188, 43215], [43226, 43249], [43256, 43258], [43260, 43263],
[43302, 43311], [43335, 43359], [43389, 43395], [43443, 43470], [43482, 43519],
[43561, 43583], [43596, 43599], [43610, 43615], [43639, 43641], [43643, 43647],
[43698, 43700], [43703, 43704], [43710, 43711], [43715, 43738], [43742, 43967],
[44003, 44015], [44026, 44031], [55204, 55215], [55239, 55242], [55292, 55295],
[57344, 63743], [64046, 64047], [64110, 64111], [64218, 64255], [64263, 64274],
[64280, 64284], [64434, 64466], [64830, 64847], [64912, 64913], [64968, 65007],
[65020, 65135], [65277, 65295], [65306, 65312], [65339, 65344], [65371, 65381],
[65471, 65473], [65480, 65481], [65488, 65489], [65496, 65497]];
for (i = 0; i < ranges.length; i++) {
start = ranges[i][0];
end = ranges[i][1];
for (j = start; j <= end; j++) {
result[j] = true;
}
}
return result;
})();
function splitQuery(query) {
var result = [];
var start = -1;
for (var i = 0; i < query.length; i++) {
if (splitChars[query.charCodeAt(i)]) {
if (start !== -1) {
result.push(query.slice(start, i));
start = -1;
}
} else if (start === -1) {
start = i;
}
}
if (start !== -1) {
result.push(query.slice(start));
}
return result;
}

View File

@ -4,22 +4,24 @@
*
* Sphinx JavaScript utilities for the full-text search.
*
* :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
"use strict";
if (!Scorer) {
/**
* Simple result scoring code.
*/
/**
* Simple result scoring code.
*/
if (typeof Scorer === "undefined") {
var Scorer = {
// Implement the following function to further tweak the score for each result
// The function takes a result array [filename, title, anchor, descr, score]
// The function takes a result array [docname, title, anchor, descr, score, filename]
// and returns the new score.
/*
score: function(result) {
return result[4];
score: result => {
const [docname, title, anchor, descr, score, filename] = result
return score
},
*/
@ -28,9 +30,11 @@ if (!Scorer) {
// or matches in the last dotted part of the object name
objPartialMatch: 6,
// Additive scores depending on the priority of the object
objPrio: {0: 15, // used to be importantResults
1: 5, // used to be objectResults
2: -5}, // used to be unimportantResults
objPrio: {
0: 15, // used to be importantResults
1: 5, // used to be objectResults
2: -5, // used to be unimportantResults
},
// Used when the priority is not in the mapping.
objPrioDefault: 0,
@ -39,459 +43,495 @@ if (!Scorer) {
partialTitle: 7,
// query found in terms
term: 5,
partialTerm: 2
partialTerm: 2,
};
}
if (!splitQuery) {
function splitQuery(query) {
return query.split(/\s+/);
const _removeChildren = (element) => {
while (element && element.lastChild) element.removeChild(element.lastChild);
};
/**
* See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#escaping
*/
const _escapeRegExp = (string) =>
string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
const _displayItem = (item, searchTerms) => {
const docBuilder = DOCUMENTATION_OPTIONS.BUILDER;
const docUrlRoot = DOCUMENTATION_OPTIONS.URL_ROOT;
const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX;
const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX;
const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY;
const [docName, title, anchor, descr, score, _filename] = item;
let listItem = document.createElement("li");
let requestUrl;
let linkUrl;
if (docBuilder === "dirhtml") {
// dirhtml builder
let dirname = docName + "/";
if (dirname.match(/\/index\/$/))
dirname = dirname.substring(0, dirname.length - 6);
else if (dirname === "index/") dirname = "";
requestUrl = docUrlRoot + dirname;
linkUrl = requestUrl;
} else {
// normal html builders
requestUrl = docUrlRoot + docName + docFileSuffix;
linkUrl = docName + docLinkSuffix;
}
let linkEl = listItem.appendChild(document.createElement("a"));
linkEl.href = linkUrl + anchor;
linkEl.dataset.score = score;
linkEl.innerHTML = title;
if (descr)
listItem.appendChild(document.createElement("span")).innerHTML =
" (" + descr + ")";
else if (showSearchSummary)
fetch(requestUrl)
.then((responseData) => responseData.text())
.then((data) => {
if (data)
listItem.appendChild(
Search.makeSearchSummary(data, searchTerms)
);
});
Search.output.appendChild(listItem);
};
const _finishSearch = (resultCount) => {
Search.stopPulse();
Search.title.innerText = _("Search Results");
if (!resultCount)
Search.status.innerText = Documentation.gettext(
"Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories."
);
else
Search.status.innerText = _(
`Search finished, found ${resultCount} page(s) matching the search query.`
);
};
const _displayNextItem = (
results,
resultCount,
searchTerms
) => {
// results left, load the summary and display it
// this is intended to be dynamic (don't sub resultsCount)
if (results.length) {
_displayItem(results.pop(), searchTerms);
setTimeout(
() => _displayNextItem(results, resultCount, searchTerms),
5
);
}
// search finished, update title and status message
else _finishSearch(resultCount);
};
/**
* Default splitQuery function. Can be overridden in ``sphinx.search`` with a
* custom function per language.
*
* The regular expression works by splitting the string on consecutive characters
* that are not Unicode letters, numbers, underscores, or emoji characters.
* This is the same as ``\W+`` in Python, preserving the surrogate pair area.
*/
if (typeof splitQuery === "undefined") {
var splitQuery = (query) => query
.split(/[^\p{Letter}\p{Number}_\p{Emoji_Presentation}]+/gu)
.filter(term => term) // remove remaining empty strings
}
/**
* Search Module
*/
var Search = {
const Search = {
_index: null,
_queued_query: null,
_pulse_status: -1,
_index : null,
_queued_query : null,
_pulse_status : -1,
htmlToText : function(htmlString) {
var virtualDocument = document.implementation.createHTMLDocument('virtual');
var htmlElement = $(htmlString, virtualDocument);
htmlElement.find('.headerlink').remove();
docContent = htmlElement.find('[role=main]')[0];
if(docContent === undefined) {
console.warn("Content block not found. Sphinx search tries to obtain it " +
"via '[role=main]'. Could you check your theme or template.");
return "";
}
return docContent.textContent || docContent.innerText;
htmlToText: (htmlString) => {
const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html');
htmlElement.querySelectorAll(".headerlink").forEach((el) => { el.remove() });
const docContent = htmlElement.querySelector('[role="main"]');
if (docContent !== undefined) return docContent.textContent;
console.warn(
"Content block not found. Sphinx search tries to obtain it via '[role=main]'. Could you check your theme or template."
);
return "";
},
init : function() {
var params = $.getQueryParameters();
if (params.q) {
var query = params.q[0];
$('input[name="q"]')[0].value = query;
this.performSearch(query);
}
init: () => {
const query = new URLSearchParams(window.location.search).get("q");
document
.querySelectorAll('input[name="q"]')
.forEach((el) => (el.value = query));
if (query) Search.performSearch(query);
},
loadIndex : function(url) {
$.ajax({type: "GET", url: url, data: null,
dataType: "script", cache: true,
complete: function(jqxhr, textstatus) {
if (textstatus != "success") {
document.getElementById("searchindexloader").src = url;
}
}});
},
loadIndex: (url) =>
(document.body.appendChild(document.createElement("script")).src = url),
setIndex : function(index) {
var q;
this._index = index;
if ((q = this._queued_query) !== null) {
this._queued_query = null;
Search.query(q);
setIndex: (index) => {
Search._index = index;
if (Search._queued_query !== null) {
const query = Search._queued_query;
Search._queued_query = null;
Search.query(query);
}
},
hasIndex : function() {
return this._index !== null;
},
hasIndex: () => Search._index !== null,
deferQuery : function(query) {
this._queued_query = query;
},
deferQuery: (query) => (Search._queued_query = query),
stopPulse : function() {
this._pulse_status = 0;
},
stopPulse: () => (Search._pulse_status = -1),
startPulse : function() {
if (this._pulse_status >= 0)
return;
function pulse() {
var i;
startPulse: () => {
if (Search._pulse_status >= 0) return;
const pulse = () => {
Search._pulse_status = (Search._pulse_status + 1) % 4;
var dotString = '';
for (i = 0; i < Search._pulse_status; i++)
dotString += '.';
Search.dots.text(dotString);
if (Search._pulse_status > -1)
window.setTimeout(pulse, 500);
}
Search.dots.innerText = ".".repeat(Search._pulse_status);
if (Search._pulse_status >= 0) window.setTimeout(pulse, 500);
};
pulse();
},
/**
* perform a search for something (or wait until index is loaded)
*/
performSearch : function(query) {
performSearch: (query) => {
// create the required interface elements
this.out = $('#search-results');
this.title = $('<h2>' + _('Searching') + '</h2>').appendTo(this.out);
this.dots = $('<span></span>').appendTo(this.title);
this.status = $('<p class="search-summary">&nbsp;</p>').appendTo(this.out);
this.output = $('<ul class="search"/>').appendTo(this.out);
const searchText = document.createElement("h2");
searchText.textContent = _("Searching");
const searchSummary = document.createElement("p");
searchSummary.classList.add("search-summary");
searchSummary.innerText = "";
const searchList = document.createElement("ul");
searchList.classList.add("search");
$('#search-progress').text(_('Preparing search...'));
this.startPulse();
const out = document.getElementById("search-results");
Search.title = out.appendChild(searchText);
Search.dots = Search.title.appendChild(document.createElement("span"));
Search.status = out.appendChild(searchSummary);
Search.output = out.appendChild(searchList);
const searchProgress = document.getElementById("search-progress");
// Some themes don't use the search progress node
if (searchProgress) {
searchProgress.innerText = _("Preparing search...");
}
Search.startPulse();
// index already loaded, the browser was quick!
if (this.hasIndex())
this.query(query);
else
this.deferQuery(query);
if (Search.hasIndex()) Search.query(query);
else Search.deferQuery(query);
},
/**
* execute search (requires search index to be loaded)
*/
query : function(query) {
var i;
query: (query) => {
const filenames = Search._index.filenames;
const docNames = Search._index.docnames;
const titles = Search._index.titles;
const allTitles = Search._index.alltitles;
const indexEntries = Search._index.indexentries;
// stem the searchterms and add them to the correct list
var stemmer = new Stemmer();
var searchterms = [];
var excluded = [];
var hlterms = [];
var tmp = splitQuery(query);
var objectterms = [];
for (i = 0; i < tmp.length; i++) {
if (tmp[i] !== "") {
objectterms.push(tmp[i].toLowerCase());
}
// stem the search terms and add them to the correct list
const stemmer = new Stemmer();
const searchTerms = new Set();
const excludedTerms = new Set();
const highlightTerms = new Set();
const objectTerms = new Set(splitQuery(query.toLowerCase().trim()));
splitQuery(query.trim()).forEach((queryTerm) => {
const queryTermLower = queryTerm.toLowerCase();
// maybe skip this "word"
// stopwords array is from language_data.js
if (
stopwords.indexOf(queryTermLower) !== -1 ||
queryTerm.match(/^\d+$/)
)
return;
if ($u.indexOf(stopwords, tmp[i].toLowerCase()) != -1 || tmp[i] === "") {
// skip this "word"
continue;
}
// stem the word
var word = stemmer.stemWord(tmp[i].toLowerCase());
// prevent stemmer from cutting word smaller than two chars
if(word.length < 3 && tmp[i].length >= 3) {
word = tmp[i];
}
var toAppend;
let word = stemmer.stemWord(queryTermLower);
// select the correct list
if (word[0] == '-') {
toAppend = excluded;
word = word.substr(1);
}
if (word[0] === "-") excludedTerms.add(word.substr(1));
else {
toAppend = searchterms;
hlterms.push(tmp[i].toLowerCase());
searchTerms.add(word);
highlightTerms.add(queryTermLower);
}
// only add if not already in the list
if (!$u.contains(toAppend, word))
toAppend.push(word);
});
if (SPHINX_HIGHLIGHT_ENABLED) { // set in sphinx_highlight.js
localStorage.setItem("sphinx_highlight_terms", [...highlightTerms].join(" "))
}
var highlightstring = '?highlight=' + $.urlencode(hlterms.join(" "));
// console.debug('SEARCH: searching for:');
// console.info('required: ', searchterms);
// console.info('excluded: ', excluded);
// console.debug("SEARCH: searching for:");
// console.info("required: ", [...searchTerms]);
// console.info("excluded: ", [...excludedTerms]);
// prepare search
var terms = this._index.terms;
var titleterms = this._index.titleterms;
// array of [docname, title, anchor, descr, score, filename]
let results = [];
_removeChildren(document.getElementById("search-progress"));
// array of [filename, title, anchor, descr, score]
var results = [];
$('#search-progress').empty();
const queryLower = query.toLowerCase();
for (const [title, foundTitles] of Object.entries(allTitles)) {
if (title.toLowerCase().includes(queryLower) && (queryLower.length >= title.length/2)) {
for (const [file, id] of foundTitles) {
let score = Math.round(100 * queryLower.length / title.length)
results.push([
docNames[file],
titles[file] !== title ? `${titles[file]} > ${title}` : title,
id !== null ? "#" + id : "",
null,
score,
filenames[file],
]);
}
}
}
// search for explicit entries in index directives
for (const [entry, foundEntries] of Object.entries(indexEntries)) {
if (entry.includes(queryLower) && (queryLower.length >= entry.length/2)) {
for (const [file, id] of foundEntries) {
let score = Math.round(100 * queryLower.length / entry.length)
results.push([
docNames[file],
titles[file],
id ? "#" + id : "",
null,
score,
filenames[file],
]);
}
}
}
// lookup as object
for (i = 0; i < objectterms.length; i++) {
var others = [].concat(objectterms.slice(0, i),
objectterms.slice(i+1, objectterms.length));
results = results.concat(this.performObjectSearch(objectterms[i], others));
}
objectTerms.forEach((term) =>
results.push(...Search.performObjectSearch(term, objectTerms))
);
// lookup as search terms in fulltext
results = results.concat(this.performTermsSearch(searchterms, excluded, terms, titleterms));
results.push(...Search.performTermsSearch(searchTerms, excludedTerms));
// let the scorer override scores with a custom scoring function
if (Scorer.score) {
for (i = 0; i < results.length; i++)
results[i][4] = Scorer.score(results[i]);
}
if (Scorer.score) results.forEach((item) => (item[4] = Scorer.score(item)));
// now sort the results by score (in opposite order of appearance, since the
// display function below uses pop() to retrieve items) and then
// alphabetically
results.sort(function(a, b) {
var left = a[4];
var right = b[4];
if (left > right) {
return 1;
} else if (left < right) {
return -1;
} else {
results.sort((a, b) => {
const leftScore = a[4];
const rightScore = b[4];
if (leftScore === rightScore) {
// same score: sort alphabetically
left = a[1].toLowerCase();
right = b[1].toLowerCase();
return (left > right) ? -1 : ((left < right) ? 1 : 0);
const leftTitle = a[1].toLowerCase();
const rightTitle = b[1].toLowerCase();
if (leftTitle === rightTitle) return 0;
return leftTitle > rightTitle ? -1 : 1; // inverted is intentional
}
return leftScore > rightScore ? 1 : -1;
});
// remove duplicate search results
// note the reversing of results, so that in the case of duplicates, the highest-scoring entry is kept
let seen = new Set();
results = results.reverse().reduce((acc, result) => {
let resultStr = result.slice(0, 4).concat([result[5]]).map(v => String(v)).join(',');
if (!seen.has(resultStr)) {
acc.push(result);
seen.add(resultStr);
}
return acc;
}, []);
results = results.reverse();
// for debugging
//Search.lastresults = results.slice(); // a copy
//console.info('search results:', Search.lastresults);
// console.info("search results:", Search.lastresults);
// print the results
var resultCount = results.length;
function displayNextItem() {
// results left, load the summary and display it
if (results.length) {
var item = results.pop();
var listItem = $('<li></li>');
var requestUrl = "";
var linkUrl = "";
if (DOCUMENTATION_OPTIONS.BUILDER === 'dirhtml') {
// dirhtml builder
var dirname = item[0] + '/';
if (dirname.match(/\/index\/$/)) {
dirname = dirname.substring(0, dirname.length-6);
} else if (dirname == 'index/') {
dirname = '';
}
requestUrl = DOCUMENTATION_OPTIONS.URL_ROOT + dirname;
linkUrl = requestUrl;
} else {
// normal html builders
requestUrl = DOCUMENTATION_OPTIONS.URL_ROOT + item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX;
linkUrl = item[0] + DOCUMENTATION_OPTIONS.LINK_SUFFIX;
}
listItem.append($('<a/>').attr('href',
linkUrl +
highlightstring + item[2]).html(item[1]));
if (item[3]) {
listItem.append($('<span> (' + item[3] + ')</span>'));
Search.output.append(listItem);
setTimeout(function() {
displayNextItem();
}, 5);
} else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
$.ajax({url: requestUrl,
dataType: "text",
complete: function(jqxhr, textstatus) {
var data = jqxhr.responseText;
if (data !== '' && data !== undefined) {
var summary = Search.makeSearchSummary(data, searchterms, hlterms);
if (summary) {
listItem.append(summary);
}
}
Search.output.append(listItem);
setTimeout(function() {
displayNextItem();
}, 5);
}});
} else {
// no source available, just display title
Search.output.append(listItem);
setTimeout(function() {
displayNextItem();
}, 5);
}
}
// search finished, update title and status message
else {
Search.stopPulse();
Search.title.text(_('Search Results'));
if (!resultCount)
Search.status.text(_('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.'));
else
Search.status.text(_('Search finished, found %s page(s) matching the search query.').replace('%s', resultCount));
Search.status.fadeIn(500);
}
}
displayNextItem();
_displayNextItem(results, results.length, searchTerms);
},
/**
* search for object names
*/
performObjectSearch : function(object, otherterms) {
var filenames = this._index.filenames;
var docnames = this._index.docnames;
var objects = this._index.objects;
var objnames = this._index.objnames;
var titles = this._index.titles;
performObjectSearch: (object, objectTerms) => {
const filenames = Search._index.filenames;
const docNames = Search._index.docnames;
const objects = Search._index.objects;
const objNames = Search._index.objnames;
const titles = Search._index.titles;
var i;
var results = [];
const results = [];
for (var prefix in objects) {
if (!(objects[prefix] instanceof Array)) {
objects[prefix] = Object.entries(objects[prefix]).map(([name, match]) => [...match, name]);
const objectSearchCallback = (prefix, match) => {
const name = match[4]
const fullname = (prefix ? prefix + "." : "") + name;
const fullnameLower = fullname.toLowerCase();
if (fullnameLower.indexOf(object) < 0) return;
let score = 0;
const parts = fullnameLower.split(".");
// check for different match types: exact matches of full name or
// "last name" (i.e. last dotted part)
if (fullnameLower === object || parts.slice(-1)[0] === object)
score += Scorer.objNameMatch;
else if (parts.slice(-1)[0].indexOf(object) > -1)
score += Scorer.objPartialMatch; // matches in last name
const objName = objNames[match[1]][2];
const title = titles[match[0]];
// If more than one term searched for, we require other words to be
// found in the name/title/description
const otherTerms = new Set(objectTerms);
otherTerms.delete(object);
if (otherTerms.size > 0) {
const haystack = `${prefix} ${name} ${objName} ${title}`.toLowerCase();
if (
[...otherTerms].some((otherTerm) => haystack.indexOf(otherTerm) < 0)
)
return;
}
for (var iMatch = 0; iMatch != objects[prefix].length; ++iMatch) {
var match = objects[prefix][iMatch];
var name = match[4];
var fullname = (prefix ? prefix + '.' : '') + name;
var fullnameLower = fullname.toLowerCase()
if (fullnameLower.indexOf(object) > -1) {
var score = 0;
var parts = fullnameLower.split('.');
// check for different match types: exact matches of full name or
// "last name" (i.e. last dotted part)
if (fullnameLower == object || parts[parts.length - 1] == object) {
score += Scorer.objNameMatch;
// matches in last name
} else if (parts[parts.length - 1].indexOf(object) > -1) {
score += Scorer.objPartialMatch;
}
var objname = objnames[match[1]][2];
var title = titles[match[0]];
// If more than one term searched for, we require other words to be
// found in the name/title/description
if (otherterms.length > 0) {
var haystack = (prefix + ' ' + name + ' ' +
objname + ' ' + title).toLowerCase();
var allfound = true;
for (i = 0; i < otherterms.length; i++) {
if (haystack.indexOf(otherterms[i]) == -1) {
allfound = false;
break;
}
}
if (!allfound) {
continue;
}
}
var descr = objname + _(', in ') + title;
var anchor = match[3];
if (anchor === '')
anchor = fullname;
else if (anchor == '-')
anchor = objnames[match[1]][1] + '-' + fullname;
// add custom score for some objects according to scorer
if (Scorer.objPrio.hasOwnProperty(match[2])) {
score += Scorer.objPrio[match[2]];
} else {
score += Scorer.objPrioDefault;
}
results.push([docnames[match[0]], fullname, '#'+anchor, descr, score, filenames[match[0]]]);
}
}
}
let anchor = match[3];
if (anchor === "") anchor = fullname;
else if (anchor === "-") anchor = objNames[match[1]][1] + "-" + fullname;
const descr = objName + _(", in ") + title;
// add custom score for some objects according to scorer
if (Scorer.objPrio.hasOwnProperty(match[2]))
score += Scorer.objPrio[match[2]];
else score += Scorer.objPrioDefault;
results.push([
docNames[match[0]],
fullname,
"#" + anchor,
descr,
score,
filenames[match[0]],
]);
};
Object.keys(objects).forEach((prefix) =>
objects[prefix].forEach((array) =>
objectSearchCallback(prefix, array)
)
);
return results;
},
/**
* See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
*/
escapeRegExp : function(string) {
return string.replace(/[.*+\-?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
},
/**
* search for full-text terms in the index
*/
performTermsSearch : function(searchterms, excluded, terms, titleterms) {
var docnames = this._index.docnames;
var filenames = this._index.filenames;
var titles = this._index.titles;
performTermsSearch: (searchTerms, excludedTerms) => {
// prepare search
const terms = Search._index.terms;
const titleTerms = Search._index.titleterms;
const filenames = Search._index.filenames;
const docNames = Search._index.docnames;
const titles = Search._index.titles;
var i, j, file;
var fileMap = {};
var scoreMap = {};
var results = [];
const scoreMap = new Map();
const fileMap = new Map();
// perform the search on the required terms
for (i = 0; i < searchterms.length; i++) {
var word = searchterms[i];
var files = [];
var _o = [
{files: terms[word], score: Scorer.term},
{files: titleterms[word], score: Scorer.title}
searchTerms.forEach((word) => {
const files = [];
const arr = [
{ files: terms[word], score: Scorer.term },
{ files: titleTerms[word], score: Scorer.title },
];
// add support for partial matches
if (word.length > 2) {
var word_regex = this.escapeRegExp(word);
for (var w in terms) {
if (w.match(word_regex) && !terms[word]) {
_o.push({files: terms[w], score: Scorer.partialTerm})
}
}
for (var w in titleterms) {
if (w.match(word_regex) && !titleterms[word]) {
_o.push({files: titleterms[w], score: Scorer.partialTitle})
}
}
const escapedWord = _escapeRegExp(word);
Object.keys(terms).forEach((term) => {
if (term.match(escapedWord) && !terms[word])
arr.push({ files: terms[term], score: Scorer.partialTerm });
});
Object.keys(titleTerms).forEach((term) => {
if (term.match(escapedWord) && !titleTerms[word])
arr.push({ files: titleTerms[word], score: Scorer.partialTitle });
});
}
// no match but word was a required one
if ($u.every(_o, function(o){return o.files === undefined;})) {
break;
}
if (arr.every((record) => record.files === undefined)) return;
// found search word in contents
$u.each(_o, function(o) {
var _files = o.files;
if (_files === undefined)
return
arr.forEach((record) => {
if (record.files === undefined) return;
if (_files.length === undefined)
_files = [_files];
files = files.concat(_files);
let recordFiles = record.files;
if (recordFiles.length === undefined) recordFiles = [recordFiles];
files.push(...recordFiles);
// set score for the word in each file to Scorer.term
for (j = 0; j < _files.length; j++) {
file = _files[j];
if (!(file in scoreMap))
scoreMap[file] = {};
scoreMap[file][word] = o.score;
}
// set score for the word in each file
recordFiles.forEach((file) => {
if (!scoreMap.has(file)) scoreMap.set(file, {});
scoreMap.get(file)[word] = record.score;
});
});
// create the mapping
for (j = 0; j < files.length; j++) {
file = files[j];
if (file in fileMap && fileMap[file].indexOf(word) === -1)
fileMap[file].push(word);
else
fileMap[file] = [word];
}
}
files.forEach((file) => {
if (fileMap.has(file) && fileMap.get(file).indexOf(word) === -1)
fileMap.get(file).push(word);
else fileMap.set(file, [word]);
});
});
// now check if the files don't contain excluded terms
for (file in fileMap) {
var valid = true;
const results = [];
for (const [file, wordList] of fileMap) {
// check if all requirements are matched
var filteredTermCount = // as search terms with length < 3 are discarded: ignore
searchterms.filter(function(term){return term.length > 2}).length
// as search terms with length < 3 are discarded
const filteredTermCount = [...searchTerms].filter(
(term) => term.length > 2
).length;
if (
fileMap[file].length != searchterms.length &&
fileMap[file].length != filteredTermCount
) continue;
wordList.length !== searchTerms.size &&
wordList.length !== filteredTermCount
)
continue;
// ensure that none of the excluded terms is in the search result
for (i = 0; i < excluded.length; i++) {
if (terms[excluded[i]] == file ||
titleterms[excluded[i]] == file ||
$u.contains(terms[excluded[i]] || [], file) ||
$u.contains(titleterms[excluded[i]] || [], file)) {
valid = false;
break;
}
}
if (
[...excludedTerms].some(
(term) =>
terms[term] === file ||
titleTerms[term] === file ||
(terms[term] || []).includes(file) ||
(titleTerms[term] || []).includes(file)
)
)
break;
// if we have still a valid result we can add it to the result list
if (valid) {
// select one (max) score for the file.
// for better ranking, we should calculate ranking by using words statistics like basic tf-idf...
var score = $u.max($u.map(fileMap[file], function(w){return scoreMap[file][w]}));
results.push([docnames[file], titles[file], '', null, score, filenames[file]]);
}
// select one (max) score for the file.
const score = Math.max(...wordList.map((w) => scoreMap.get(file)[w]));
// add result to the result list
results.push([
docNames[file],
titles[file],
"",
null,
score,
filenames[file],
]);
}
return results;
},
@ -499,34 +539,28 @@ var Search = {
/**
* helper function to return a node containing the
* search summary for a given text. keywords is a list
* of stemmed words, hlwords is the list of normal, unstemmed
* words. the first one is used to find the occurrence, the
* latter for highlighting it.
* of stemmed words.
*/
makeSearchSummary : function(htmlText, keywords, hlwords) {
var text = Search.htmlToText(htmlText);
if (text == "") {
return null;
}
var textLower = text.toLowerCase();
var start = 0;
$.each(keywords, function() {
var i = textLower.indexOf(this.toLowerCase());
if (i > -1)
start = i;
});
start = Math.max(start - 120, 0);
var excerpt = ((start > 0) ? '...' : '') +
$.trim(text.substr(start, 240)) +
((start + 240 - text.length) ? '...' : '');
var rv = $('<p class="context"></p>').text(excerpt);
$.each(hlwords, function() {
rv = rv.highlightText(this, 'highlighted');
});
return rv;
}
makeSearchSummary: (htmlText, keywords) => {
const text = Search.htmlToText(htmlText);
if (text === "") return null;
const textLower = text.toLowerCase();
const actualStartPosition = [...keywords]
.map((k) => textLower.indexOf(k.toLowerCase()))
.filter((i) => i > -1)
.slice(-1)[0];
const startWithContext = Math.max(actualStartPosition - 120, 0);
const top = startWithContext === 0 ? "" : "...";
const tail = startWithContext + 240 < text.length ? "..." : "";
let summary = document.createElement("p");
summary.classList.add("context");
summary.textContent = top + text.substr(startWithContext, 240).trim() + tail;
return summary;
},
};
$(document).ready(function() {
Search.init();
});
_ready(Search.init);

File diff suppressed because one or more lines are too long

View File

@ -14,7 +14,9 @@
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
@ -42,6 +44,7 @@
<li class="toctree-l1 current"><a class="current reference internal" href="#">Ithamars Agenda</a></li>
<li class="toctree-l1"><a class="reference internal" href="cijfers.html">Cijferlijst</a></li>
<li class="toctree-l1"><a class="reference internal" href="escape_room.html">escape-room ithamar</a></li>
<li class="toctree-l1"><a class="reference internal" href="pico.html">Arduino pico</a></li>
</ul>
</div>
@ -69,7 +72,7 @@
<div itemprop="articleBody">
<section id="ithamar-s-agenda">
<h1>Ithamars Agenda<a class="headerlink" href="#ithamar-s-agenda" title="Permalink to this headline"></a></h1>
<h1>Ithamars Agenda<a class="headerlink" href="#ithamar-s-agenda" title="Permalink to this heading"></a></h1>
<p>Tabel van opdrachten</p>
<table class="docutils align-default">
<colgroup>
@ -107,64 +110,38 @@
</div>
</td>
</tr>
<tr class="row-odd"><td><p>verslag arduino bluetooth</p></td>
<td><p>24 december</p></td>
<td><p>kan digitaal worden opgestuurd</p></td>
<tr class="row-odd"><td><p>HerExamen 2 SQLite</p></td>
<td></td>
<td><p>lees dit keer iets meer door</p></td>
<td></td>
</tr>
<tr class="row-even"><td><p>Opdracht 21: Sensor uitlezen met Ardutooth</p></td>
<td><p>24 december</p></td>
<td><p>moet worden gepresenteerd</p></td>
<tr class="row-even"><td><p>Nederlands her-Examen 3</p></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>Elevator pitch zelfreflectie verslag</p></td>
<td><p>23 november</p></td>
<td><p>Inleveren via teams</p></td>
<tr class="row-odd"><td><p>Stage + opdracht</p></td>
<td><p>januari</p></td>
<td><p>moet voor periode 3 januri geregeld zijn</p></td>
<td></td>
</tr>
<tr class="row-even"><td><p>Opdracht 22: Onderzoek Security wireless comm.</p></td>
<td><p>24 december</p></td>
<td><p>moet worden gepresenteerd</p></td>
<tr class="row-even"><td><p>Afstudeerstage + opdracht</p></td>
<td><p>20 januari</p></td>
<td><p>vereist voor het cijfer van SQLite</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>Opdracht 23 IR control</p></td>
<td><p>24 december</p></td>
<td><p>moet worden gepresenteerd</p></td>
<tr class="row-odd"><td><p>Keuzevak voor jaar 2</p></td>
<td><p>2023-2024</p></td>
<td><p>opmaak voor gefaald zorgrobot, japans misschien?</p></td>
<td></td>
</tr>
<tr class="row-even"><td><p>Opdracht 24a - b Ventilator met 433mhz</p></td>
<td><p>24 december</p></td>
<td><p>moet worden gepresenteerd</p></td>
<tr class="row-even"><td><p>Haal firebeetle op van paul</p></td>
<td colspan="2"><p>4 september 2023 - 28 juli 2024 | uitleensel</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>Opdracht 25 - tempverloop op SD (thuis)</p></td>
<td><p>24 december</p></td>
<td><p>moet worden gepresenteerd</p></td>
<td></td>
</tr>
<tr class="row-even"><td><p>Opdracht 27 - ESP8266 - webserver</p></td>
<td><p>24 december</p></td>
<td><p>moet worden gepresenteerd</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>Opdracht 28 - ESP8266 - client - data-analyse.</p></td>
<td><p>24 december</p></td>
<td><p>moet worden gepresenteerd</p></td>
<td></td>
</tr>
<tr class="row-even"><td><p>python 2 rgb ledstrip opdracht 2</p></td>
<td><p>10 december</p></td>
<td><p>moet worden gepresenteerd</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>Cisco week opdrachten</p></td>
<td><p>24 december</p></td>
<td><p>alle opdrachten moeten gezipt worden ingeleverd aan het einde van de periode</p></td>
<td></td>
</tr>
<tr class="row-even"><td><p>workshop escaperoom</p></td>
<td><p>18 januari 2023</p></td>
<td><p>de escaperoom moet worden verwerkt in een presentatie tijdens te toetsweek</p></td>
<tr class="row-odd"><td><p>Fnaf movie october</p></td>
<td><p>27 october</p></td>
<td><p>Groep/solo uitje</p></td>
<td></td>
</tr>
</tbody>

View File

@ -14,7 +14,9 @@
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
@ -42,6 +44,7 @@
<li class="toctree-l1"><a class="reference internal" href="agenda.html">Ithamars Agenda</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Cijferlijst</a></li>
<li class="toctree-l1"><a class="reference internal" href="escape_room.html">escape-room ithamar</a></li>
<li class="toctree-l1"><a class="reference internal" href="pico.html">Arduino pico</a></li>
</ul>
</div>
@ -69,7 +72,7 @@
<div itemprop="articleBody">
<section id="cijferlijst">
<h1>Cijferlijst<a class="headerlink" href="#cijferlijst" title="Permalink to this headline"></a></h1>
<h1>Cijferlijst<a class="headerlink" href="#cijferlijst" title="Permalink to this heading"></a></h1>
<table class="docutils align-default">
<colgroup>
<col style="width: 48%" />

View File

@ -14,10 +14,13 @@
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Arduino pico" href="pico.html" />
<link rel="prev" title="Cijferlijst" href="cijfers.html" />
</head>
@ -41,6 +44,7 @@
<li class="toctree-l1"><a class="reference internal" href="agenda.html">Ithamars Agenda</a></li>
<li class="toctree-l1"><a class="reference internal" href="cijfers.html">Cijferlijst</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">escape-room ithamar</a></li>
<li class="toctree-l1"><a class="reference internal" href="pico.html">Arduino pico</a></li>
</ul>
</div>
@ -68,14 +72,25 @@
<div itemprop="articleBody">
<section id="escape-room-ithamar">
<h1>escape-room ithamar<a class="headerlink" href="#escape-room-ithamar" title="Permalink to this headline"></a></h1>
<h1>escape-room ithamar<a class="headerlink" href="#escape-room-ithamar" title="Permalink to this heading"></a></h1>
<p>Documentatie voor ithamars escaperoom.</p>
<p>Voor jaar 1 periode 2 van mijn studie IoT moet ik een escaperoom maken met een arduino in een groepje. deze escaperoom
moet gemaakt worden via de kennis die is opgedaan met de opdrachten van de werkplaats arduino.</p>
<p>Het groepje waarbij ik zit heeft als thema: horror, ondanks dit theme is de echte horror een doos vinden om de escaperoom uit te maken
en op tijd de puzzles te maken en te kunnen verwerken in deze doos.</p>
<p>De puzzel die ik wil maken is afgeleid van de ::ref:<a href="#id1"><span class="problematic" id="id2">`</span></a><a class="reference external" href="https://www.youtube.com/watch">https://www.youtube.com/watch</a>?v=VaPQGiTq8Bc&lt;oneshot color puzzle&gt;</p>
<p>De puzzel die ik wil maken is afgeleid van de <a class="reference external" href="https://www.youtube.com/watch?v=VaPQGiTq8Bc">oneshot color puzzle</a></p>
<img alt="_images/design.png" src="_images/design.png" />
<p>Bij de eerste sketch waren RGB leds gekozen om de lampjes te representeren, maar om kabels te besparen zullen we dit vervangen met leds van een
WS2812B. Hiervoor is een simpele sketch gemaakt om vanaf te werken.</p>
<img alt="_images/nwsketch.png" src="_images/nwsketch.png" />
<p>8 december: de puzzel is fysiek compleet maar moet nog geprogrammeerd worden en de bekabeling gecontroleerd, zodra dit gedeelte klaar is zijn er
nog 2 mogelijke problemen met het gehele project: de puzzel naar puzzel communicatie en de intergratie van in de escapedoos.</p>
<img alt="_images/nanobuild.jpg" src="_images/nanobuild.jpg" />
<p>11 december: De puzzel is nog in productie maar het finale product is besloten, om het concept van de puzzel over te brengen heb ik ook een flowchart
gemaakt om het process uit te leggen</p>
<img alt="_images/flowchart.drawio" src="_images/flowchart.drawio" />
<p>27 januari: De puzzel is in hout gezet voor de presentatie, helaas was bij de decoratie de opbouw van de puzzel niet in consideratie genomen. Hierdoor is de originele
decoratie niet gebruikt in het eindproduct.</p>
</section>
@ -83,6 +98,7 @@ en op tijd de puzzles te maken en te kunnen verwerken in deze doos.</p>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="cijfers.html" class="btn btn-neutral float-left" title="Cijferlijst" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="pico.html" class="btn btn-neutral float-right" title="Arduino pico" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>

View File

@ -13,7 +13,9 @@
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="#" />
<link rel="search" title="Search" href="search.html" />
@ -39,6 +41,7 @@
<li class="toctree-l1"><a class="reference internal" href="agenda.html">Ithamars Agenda</a></li>
<li class="toctree-l1"><a class="reference internal" href="cijfers.html">Cijferlijst</a></li>
<li class="toctree-l1"><a class="reference internal" href="escape_room.html">escape-room ithamar</a></li>
<li class="toctree-l1"><a class="reference internal" href="pico.html">Arduino pico</a></li>
</ul>
</div>

View File

@ -14,7 +14,9 @@
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
@ -41,6 +43,7 @@
<li class="toctree-l1"><a class="reference internal" href="agenda.html">Ithamars Agenda</a></li>
<li class="toctree-l1"><a class="reference internal" href="cijfers.html">Cijferlijst</a></li>
<li class="toctree-l1"><a class="reference internal" href="escape_room.html">escape-room ithamar</a></li>
<li class="toctree-l1"><a class="reference internal" href="pico.html">Arduino pico</a></li>
</ul>
</div>
@ -68,13 +71,14 @@
<div itemprop="articleBody">
<section id="welcome-to-ithamar-s-ad-s-documentation">
<h1>Welcome to Ithamars ADs documentation!<a class="headerlink" href="#welcome-to-ithamar-s-ad-s-documentation" title="Permalink to this headline"></a></h1>
<h1>Welcome to Ithamars ADs documentation!<a class="headerlink" href="#welcome-to-ithamar-s-ad-s-documentation" title="Permalink to this heading"></a></h1>
<div class="toctree-wrapper compound">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="agenda.html">Ithamars Agenda</a></li>
<li class="toctree-l1"><a class="reference internal" href="cijfers.html">Cijferlijst</a></li>
<li class="toctree-l1"><a class="reference internal" href="escape_room.html">escape-room ithamar</a></li>
<li class="toctree-l1"><a class="reference internal" href="pico.html">Arduino pico</a></li>
</ul>
</div>
</section>

Binary file not shown.

View File

@ -0,0 +1,132 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Arduino pico &mdash; Ithamar&#39;s AD documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="prev" title="escape-room ithamar" href="escape_room.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home"> Ithamar's AD
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="agenda.html">Ithamars Agenda</a></li>
<li class="toctree-l1"><a class="reference internal" href="cijfers.html">Cijferlijst</a></li>
<li class="toctree-l1"><a class="reference internal" href="escape_room.html">escape-room ithamar</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Arduino pico</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">Ithamar's AD</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home"></a></li>
<li class="breadcrumb-item active">Arduino pico</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/pico.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="arduino-pico">
<h1>Arduino pico<a class="headerlink" href="#arduino-pico" title="Permalink to this heading"></a></h1>
<p>This is where the pico ledstrip projects are store, for a bit of context: for year 1 period 2 i am tasked with working with the arduino pico and a ledstrip (w2812B).</p>
<p>This project mostly revolves around making the ledstrip light up certain lights and patterns, the fundamental lesson that the school is trying to teach us is
learning to work with loops and statements. Through these projects we will be required to rely less on simple inputs and imports and more on thinking out of the box.</p>
<p>The files refferenced can be found in <a class="reference external" href="https://git.herreweb.nl/IthamarHerrewijnen/Ithamar_code/src/branch/main/documentation/source">https://git.herreweb.nl/IthamarHerrewijnen/Ithamar_code/src/branch/main/documentation/source</a> or the git repository.
Apart from micropython no other packages have to be installed.</p>
<p>Notable files</p>
<p>Colorwave: This is one of the files required to work with the ledstrip. It defines colors for easier use and can be used as a test file to see if a strip works or not.</p>
<details class="summary-notes">
<summary>Notes</summary><p>This code contains a lot of callable intergers, it also gives the fucntion to the ledstrip to move from left to right.</p>
</details><p>NeoPixel: this file actually programs directly into the ledstrip rather than give it some intergers. This file is required to operate the ledstrip to begin with.
therefore it is a rather large file with a full documentation on <a class="reference external" href="https://github.com/adafruit/Adafruit_NeoPixel">github</a>.</p>
<blockquote>
<div><details class="summary-notes">
<summary>notes</summary><p>This code contains all the technical functions of the ledstrip setup. The interesting part for the user are functinos such as “brightness”, “show” and “rotate”. Whereas
colorwave gave the user the colors for the ledstrip, Neopixel gives the user all the fun functions to create your own custom lighting.</p>
</details></div></blockquote>
<p>discolight_sl: This is the main file im currently using to stash all my functions in. For the moment this only includes some code i got from some <a class="reference external" href="https://git.herreweb.nl/EljakimHerrewijnen">guy</a>
called disco. My own code which is called police and a shutoff function. Because im too lazy to scroll for the functions i call them in a different file.</p>
<blockquote>
<div><details class="summary-notes">
<summary>Notes</summary><p>This code has very few interesting notes, In the function: “discolight” we use a randomizer to set every pixel to some random rgb value. In the function :”police”
we use a clever calculation to get the even numbers for one set of leds and the very same formula to get the uneven leds. After that we simply make the leds take turns
in who gets to light up first, creating a policelight effect.</p>
</details></div></blockquote>
<p>This code is a work in progress and will be continued in due time.</p>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="escape_room.html" class="btn btn-neutral float-left" title="escape-room ithamar" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2022, Ithamar.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View File

@ -14,7 +14,9 @@
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<script src="_static/js/theme.js"></script>
<script src="_static/searchtools.js"></script>
<script src="_static/language_data.js"></script>
@ -42,6 +44,7 @@
<li class="toctree-l1"><a class="reference internal" href="agenda.html">Ithamars Agenda</a></li>
<li class="toctree-l1"><a class="reference internal" href="cijfers.html">Cijferlijst</a></li>
<li class="toctree-l1"><a class="reference internal" href="escape_room.html">escape-room ithamar</a></li>
<li class="toctree-l1"><a class="reference internal" href="pico.html">Arduino pico</a></li>
</ul>
</div>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,42 @@
# Example showing how functions, that accept tuples of rgb values,
# simplify working with gradients
import time
from neopixel import Neopixel
numpix = 30
strip = Neopixel(numpix, 0, 28, "GRB")
# strip = Neopixel(numpsix, 0, 0, "GRBW")
red = (255, 0, 0)
orange = (255, 50, 0)
yellow = (255, 100, 0)
green = (0, 255, 0)
blue = (0, 0, 255)
indigo = (100, 0, 90)
violet = (200, 0, 100)
colors_rgb = [red, orange, yellow, green, blue, indigo, violet]
# same colors as normaln rgb, just 0 added at the end
colors_rgbw = [color+tuple([0]) for color in colors_rgb]
colors_rgbw.append((0, 0, 0, 255))
# uncomment colors_rgbw if you have RGBW strip
colors = colors_rgb
# colors = colors_rgbw
step = round(numpix / len(colors))
current_pixel = 0
strip.brightness(50)
for color1, color2 in zip(colors, colors[1:]):
strip.set_pixel_line_gradient(current_pixel, current_pixel + step, color1, color2)
current_pixel += step
strip.set_pixel_line_gradient(current_pixel, numpix - 1, violet, red)
while True:
strip.rotate_right(1)
time.sleep(0.15)
strip.show()

View File

@ -0,0 +1,63 @@
from neopixel import Neopixel
import random
import time
def DiscoLed():
pixels = Neopixel(30, 0, 16, "GRB")
# pixels.fill((255, 255, 255))
# pixels.brightness(50)
# pixels.fill(orange)
while True:
for i in range(30):
pixels.set_pixel(i, (random.randint(0,255),random.randint(0,255),random.randint(0,255)))
pixels.brightness(random.randint(0,50))
pixels.show()
def police():
pixels = Neopixel(30, 0, 16, "GRB")
red = (255, 0, 0)
blue = (9, 0, 255)
null = (0, 0, 0)
redls = []
bluels = []
knipper_aan = True
while True:
if knipper_aan:
for i in range(30):
if i % 2 == 0:
redls.append(i)
pixels.set_pixel(i, red)
# time.sleep(0.1)
pixels.show()
knipper_aan = False
time.sleep(1)
pixels.fill(null)
time.sleep(1)
if knipper_aan == False:
for u in range(30):
if u % 2 != 0:
bluels.append(u)
pixels.set_pixel(u, blue)
# time.sleep(0.1)
pixels.show()
knipper_aan = True
pixels.fill(null)
time.sleep(2)
# else:
# knipper_aan = True
# for u in range(30):
# if u % 2 == -1:
# pixels.set_pixel(u, blue)
# time.sleep(1)
pixels.brightness(30)
pixels.show()
def shutoff():
pixels = Neopixel(30, 0, 16, "GRB")
pixels.fill((0, 0, 0))
pixels.show()

View File

@ -0,0 +1,5 @@
from discolight_sl import *
# DiscoLed()
police()
# shutoff()

View File

@ -0,0 +1,200 @@
import array, time
from machine import Pin
import rp2
# PIO state machine for RGB. Pulls 24 bits (rgb -> 3 * 8bit) automatically
@rp2.asm_pio(sideset_init=rp2.PIO.OUT_LOW, out_shiftdir=rp2.PIO.SHIFT_LEFT, autopull=True, pull_thresh=24)
def ws2812():
T1 = 2
T2 = 5
T3 = 3
wrap_target()
label("bitloop")
out(x, 1) .side(0) [T3 - 1]
jmp(not_x, "do_zero") .side(1) [T1 - 1]
jmp("bitloop") .side(1) [T2 - 1]
label("do_zero")
nop().side(0) [T2 - 1]
wrap()
# PIO state machine for RGBW. Pulls 32 bits (rgbw -> 4 * 8bit) automatically
@rp2.asm_pio(sideset_init=rp2.PIO.OUT_LOW, out_shiftdir=rp2.PIO.SHIFT_LEFT, autopull=True, pull_thresh=32)
def sk6812():
T1 = 2
T2 = 5
T3 = 3
wrap_target()
label("bitloop")
out(x, 1) .side(0) [T3 - 1]
jmp(not_x, "do_zero") .side(1) [T1 - 1]
jmp("bitloop") .side(1) [T2 - 1]
label("do_zero")
nop() .side(0) [T2 - 1]
wrap()
# Delay here is the reset time. You need a pause to reset the LED strip back to the initial LED
# however, if you have quite a bit of processing to do before the next time you update the strip
# you could put in delay=0 (or a lower delay)
#
# Class supports different order of individual colors (GRB, RGB, WRGB, GWRB ...). In order to achieve
# this, we need to flip the indexes: in 'RGBW', 'R' is on index 0, but we need to shift it left by 3 * 8bits,
# so in it's inverse, 'WBGR', it has exactly right index. Since micropython doesn't have [::-1] and recursive rev()
# isn't too efficient we simply do that by XORing (operator ^) each index with 3 (0b11) to make this flip.
# When dealing with just 'RGB' (3 letter string), this means same but reduced by 1 after XOR!.
# Example: in 'GRBW' we want final form of 0bGGRRBBWW, meaning G with index 0 needs to be shifted 3 * 8bit ->
# 'G' on index 0: 0b00 ^ 0b11 -> 0b11 (3), just as we wanted.
# Same hold for every other index (and - 1 at the end for 3 letter strings).
class Neopixel:
def __init__(self, num_leds, state_machine, pin, mode="RGB", delay=0.0001):
self.pixels = array.array("I", [0 for _ in range(num_leds)])
self.mode = set(mode) # set for better performance
if 'W' in self.mode:
# RGBW uses different PIO state machine configuration
self.sm = rp2.StateMachine(state_machine, sk6812, freq=8000000, sideset_base=Pin(pin))
# dictionary of values required to shift bit into position (check class desc.)
self.shift = {'R': (mode.index('R') ^ 3) * 8, 'G': (mode.index('G') ^ 3) * 8,
'B': (mode.index('B') ^ 3) * 8, 'W': (mode.index('W') ^ 3) * 8}
else:
self.sm = rp2.StateMachine(state_machine, ws2812, freq=8000000, sideset_base=Pin(pin))
self.shift = {'R': ((mode.index('R') ^ 3) - 1) * 8, 'G': ((mode.index('G') ^ 3) - 1) * 8,
'B': ((mode.index('B') ^ 3) - 1) * 8, 'W': 0}
self.sm.active(1)
self.num_leds = num_leds
self.delay = delay
self.brightnessvalue = 255
# Set the overal value to adjust brightness when updating leds
def brightness(self, brightness=None):
if brightness == None:
return self.brightnessvalue
else:
if brightness < 1:
brightness = 1
if brightness > 255:
brightness = 255
self.brightnessvalue = brightness
# Create a gradient with two RGB colors between "pixel1" and "pixel2" (inclusive)
# Function accepts two (r, g, b) / (r, g, b, w) tuples
def set_pixel_line_gradient(self, pixel1, pixel2, left_rgb_w, right_rgb_w):
if pixel2 - pixel1 == 0:
return
right_pixel = max(pixel1, pixel2)
left_pixel = min(pixel1, pixel2)
for i in range(right_pixel - left_pixel + 1):
fraction = i / (right_pixel - left_pixel)
red = round((right_rgb_w[0] - left_rgb_w[0]) * fraction + left_rgb_w[0])
green = round((right_rgb_w[1] - left_rgb_w[1]) * fraction + left_rgb_w[1])
blue = round((right_rgb_w[2] - left_rgb_w[2]) * fraction + left_rgb_w[2])
# if it's (r, g, b, w)
if len(left_rgb_w) == 4 and 'W' in self.mode:
white = round((right_rgb_w[3] - left_rgb_w[3]) * fraction + left_rgb_w[3])
self.set_pixel(left_pixel + i, (red, green, blue, white))
else:
self.set_pixel(left_pixel + i, (red, green, blue))
# Set an array of pixels starting from "pixel1" to "pixel2" (inclusive) to the desired color.
# Function accepts (r, g, b) / (r, g, b, w) tuple
def set_pixel_line(self, pixel1, pixel2, rgb_w):
for i in range(pixel1, pixel2 + 1):
self.set_pixel(i, rgb_w)
# Set red, green and blue value of pixel on position <pixel_num>
# Function accepts (r, g, b) / (r, g, b, w) tuple
def set_pixel(self, pixel_num, rgb_w):
pos = self.shift
red = round(rgb_w[0] * (self.brightness() / 255))
green = round(rgb_w[1] * (self.brightness() / 255))
blue = round(rgb_w[2] * (self.brightness() / 255))
white = 0
# if it's (r, g, b, w)
if len(rgb_w) == 4 and 'W' in self.mode:
white = round(rgb_w[3] * (self.brightness() / 255))
self.pixels[pixel_num] = white << pos['W'] | blue << pos['B'] | red << pos['R'] | green << pos['G']
# Converts HSV color to rgb tuple and returns it
# Function accepts integer values for <hue>, <saturation> and <value>
# The logic is almost the same as in Adafruit NeoPixel library:
# https://github.com/adafruit/Adafruit_NeoPixel so all the credits for that
# go directly to them (license: https://github.com/adafruit/Adafruit_NeoPixel/blob/master/COPYING)
def colorHSV(self, hue, sat, val):
if hue >= 65536:
hue %= 65536
hue = (hue * 1530 + 32768) // 65536
if hue < 510:
b = 0
if hue < 255:
r = 255
g = hue
else:
r = 510 - hue
g = 255
elif hue < 1020:
r = 0
if hue < 765:
g = 255
b = hue - 510
else:
g = 1020 - hue
b = 255
elif hue < 1530:
g = 0
if hue < 1275:
r = hue - 1020
b = 255
else:
r = 255
b = 1530 - hue
else:
r = 255
g = 0
b = 0
v1 = 1 + val
s1 = 1 + sat
s2 = 255 - sat
r = ((((r * s1) >> 8) + s2) * v1) >> 8
g = ((((g * s1) >> 8) + s2) * v1) >> 8
b = ((((b * s1) >> 8) + s2) * v1) >> 8
return r, g, b
# Rotate <num_of_pixels> pixels to the left
def rotate_left(self, num_of_pixels):
if num_of_pixels == None:
num_of_pixels = 1
self.pixels = self.pixels[num_of_pixels:] + self.pixels[:num_of_pixels]
# Rotate <num_of_pixels> pixels to the right
def rotate_right(self, num_of_pixels):
if num_of_pixels == None:
num_of_pixels = 1
num_of_pixels = -1 * num_of_pixels
self.pixels = self.pixels[num_of_pixels:] + self.pixels[:num_of_pixels]
# Update pixels
def show(self):
# If mode is RGB, we cut 8 bits of, otherwise we keep all 32
cut = 8
if 'W' in self.mode:
cut = 0
for i in range(self.num_leds):
self.sm.put(self.pixels[i], cut)
time.sleep(self.delay)
# Set all pixels to given rgb values
# Function accepts (r, g, b) / (r, g, b, w)
def fill(self, rgb_w):
for i in range(self.num_leds):
self.set_pixel(i, rgb_w)
time.sleep(self.delay)

View File

@ -1,7 +1,6 @@
****************
Ithamar's Agenda
****************
Tabel van opdrachten
@ -11,29 +10,18 @@ Tabel van opdrachten
|| || || || |
|| || || || |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+--------+
| verslag arduino bluetooth | 24 december | kan digitaal worden opgestuurd | |
| HerExamen 2 SQLite | ????? | lees dit keer iets meer door | |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+--------+
| Opdracht 21: Sensor uitlezen met Ardutooth | 24 december | moet worden gepresenteerd | |
| Nederlands her-Examen 3 | ???? | | |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+--------+
| Elevator pitch zelfreflectie verslag | 23 november | Inleveren via teams | |
| Stage + opdracht | januari | moet voor periode 3 januri geregeld zijn | |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+--------+
| Opdracht 22: Onderzoek Security wireless comm. | 24 december | moet worden gepresenteerd | |
| Afstudeerstage + opdracht | 20 januari | vereist voor het cijfer van SQLite | |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+--------+
| Opdracht 23 IR control | 24 december | moet worden gepresenteerd | |
| Keuzevak voor jaar 2 | 2023-2024 | opmaak voor gefaald zorgrobot, japans misschien? | |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+--------+
| Opdracht 24a - b Ventilator met 433mhz | 24 december | moet worden gepresenteerd | |
| Haal firebeetle op van paul | 4 september 2023 - 28 juli 2024 | uitleensel | |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+--------+
| Opdracht 25 - tempverloop op SD (thuis) | 24 december | moet worden gepresenteerd | |
| Fnaf movie october | 27 october | Groep/solo uitje | |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+--------+
| Opdracht 27 - ESP8266 - webserver | 24 december | moet worden gepresenteerd | |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+--------+
| Opdracht 28 - ESP8266 - client - data-analyse. | 24 december | moet worden gepresenteerd | |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+--------+
| python 2 rgb ledstrip opdracht 2 | 10 december | moet worden gepresenteerd | |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+--------+
| Cisco week opdrachten | 24 december | alle opdrachten moeten gezipt worden ingeleverd aan het einde van de periode | |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+--------+
| workshop escaperoom | 18 januari 2023 | de escaperoom moet worden verwerkt in een presentatie tijdens te toetsweek | |
+------------------------------------------------+-----------------+------------------------------------------------------------------------------+--------+

View File

@ -13,7 +13,7 @@ author = 'Ithamar'
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
extensions = ['sphinx.ext.autosectionlabel']
extensions = ['sphinx.ext.autosectionlabel', 'sphinx_toolbox.collapse']
templates_path = ['_templates']
exclude_patterns = []

View File

@ -9,6 +9,24 @@ moet gemaakt worden via de kennis die is opgedaan met de opdrachten van de werkp
Het groepje waarbij ik zit heeft als thema: horror, ondanks dit theme is de echte horror een doos vinden om de escaperoom uit te maken
en op tijd de puzzles te maken en te kunnen verwerken in deze doos.
De puzzel die ik wil maken is afgeleid van de ::ref:`https://www.youtube.com/watch?v=VaPQGiTq8Bc<oneshot color puzzle>'
De puzzel die ik wil maken is afgeleid van de `oneshot color puzzle <https://www.youtube.com/watch?v=VaPQGiTq8Bc>`_
.. image:: escape_room/design.png
Bij de eerste sketch waren RGB leds gekozen om de lampjes te representeren, maar om kabels te besparen zullen we dit vervangen met leds van een
WS2812B. Hiervoor is een simpele sketch gemaakt om vanaf te werken.
.. image:: escape_room/nwsketch.png
8 december: de puzzel is fysiek compleet maar moet nog geprogrammeerd worden en de bekabeling gecontroleerd, zodra dit gedeelte klaar is zijn er
nog 2 mogelijke problemen met het gehele project: de puzzel naar puzzel communicatie en de intergratie van in de escapedoos.
.. image:: escape_room/nanobuild.jpg
11 december: De puzzel is nog in productie maar het finale product is besloten, om het concept van de puzzel over te brengen heb ik ook een flowchart
gemaakt om het process uit te leggen
.. image:: escape_room/flowchart.drawio
27 januari: De puzzel is in hout gezet voor de presentatie, helaas was bij de decoratie de opbouw van de puzzel niet in consideratie genomen. Hierdoor is de originele
decoratie niet gebruikt in het eindproduct.

View File

@ -0,0 +1,74 @@
<mxfile host="65bd71144e">
<diagram id="C5RBs43oDa-KdzZeNtuy" name="Page-1">
<mxGraphModel dx="1204" dy="788" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-0"/>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-1" parent="WIyWlLk6GJQsqaUBKTNV-0"/>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-2" value="" style="rounded=0;html=1;jettySize=auto;orthogonalLoop=1;fontSize=11;endArrow=block;endFill=0;endSize=8;strokeWidth=1;shadow=0;labelBackgroundColor=none;edgeStyle=orthogonalEdgeStyle;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="WIyWlLk6GJQsqaUBKTNV-3" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="220" y="170" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-3" value="Nano is inactive" style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="160" y="80" width="120" height="40" as="geometry"/>
</mxCell>
<mxCell id="cu5jRHnhM64dbvBLo5j4-2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="cu5jRHnhM64dbvBLo5j4-0" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="220" y="270" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="cu5jRHnhM64dbvBLo5j4-0" value="User presses led button" style="rounded=0;whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="160" y="150" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="cu5jRHnhM64dbvBLo5j4-5" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="cu5jRHnhM64dbvBLo5j4-3" target="cu5jRHnhM64dbvBLo5j4-4" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="cu5jRHnhM64dbvBLo5j4-3" value="button status changes&lt;br&gt;counter changes to &lt;br&gt;next value" style="rounded=0;whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="160" y="240" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="cu5jRHnhM64dbvBLo5j4-7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="cu5jRHnhM64dbvBLo5j4-4" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="220" y="450" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="cu5jRHnhM64dbvBLo5j4-4" value="led changes color&lt;br&gt;based on counter value" style="rounded=0;whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="160" y="320" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="cu5jRHnhM64dbvBLo5j4-10" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="cu5jRHnhM64dbvBLo5j4-8" target="cu5jRHnhM64dbvBLo5j4-9" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="cu5jRHnhM64dbvBLo5j4-8" value="&lt;div&gt;User presses check &lt;br&gt;&lt;/div&gt;&lt;div&gt;button&lt;br&gt;&lt;/div&gt;" style="rounded=0;whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="160" y="400" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="cu5jRHnhM64dbvBLo5j4-16" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="cu5jRHnhM64dbvBLo5j4-9" target="cu5jRHnhM64dbvBLo5j4-15" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="cu5jRHnhM64dbvBLo5j4-20" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="cu5jRHnhM64dbvBLo5j4-9" target="cu5jRHnhM64dbvBLo5j4-19" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="cu5jRHnhM64dbvBLo5j4-9" value="&lt;div&gt;Are the colors&lt;/div&gt;&lt;div&gt;Correct?&lt;/div&gt;" style="rhombus;whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="170" y="470" width="100" height="100" as="geometry"/>
</mxCell>
<mxCell id="cu5jRHnhM64dbvBLo5j4-17" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="cu5jRHnhM64dbvBLo5j4-15" target="cu5jRHnhM64dbvBLo5j4-0" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="410" y="180"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="cu5jRHnhM64dbvBLo5j4-15" value="&lt;div&gt;Display correct &lt;br&gt;&lt;/div&gt;&lt;div&gt;amount of leds&lt;br&gt;&lt;/div&gt;" style="whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="340" y="490" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="cu5jRHnhM64dbvBLo5j4-18" value="NO" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="270" y="490" width="60" height="30" as="geometry"/>
</mxCell>
<mxCell id="cu5jRHnhM64dbvBLo5j4-19" value="Congrats, play jingle" style="rounded=1;whiteSpace=wrap;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry y="490" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="cu5jRHnhM64dbvBLo5j4-21" value="yes" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="120" y="490" width="60" height="30" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 KiB

View File

@ -12,4 +12,5 @@ Welcome to Ithamar's AD's documentation!
agenda.rst
cijfers.rst
escape_room.rst
escape_room.rst
pico.rst

View File

@ -0,0 +1,37 @@
Arduino pico
=============
This is where the pico ledstrip projects are store, for a bit of context: for year 1 period 2 i am tasked with working with the arduino pico and a ledstrip (w2812B).
This project mostly revolves around making the ledstrip light up certain lights and patterns, the fundamental lesson that the school is trying to teach us is
learning to work with loops and statements. Through these projects we will be required to rely less on simple inputs and imports and more on thinking out of the box.
The files refferenced can be found in https://git.herreweb.nl/IthamarHerrewijnen/Ithamar_code/src/branch/main/documentation/source or the git repository.
Apart from micropython no other packages have to be installed.
Notable files
Colorwave: This is one of the files required to work with the ledstrip. It defines colors for easier use and can be used as a test file to see if a strip works or not.
.. collapse:: Notes
This code contains a lot of callable intergers, it also gives the fucntion to the ledstrip to move from left to right.
NeoPixel: this file actually programs directly into the ledstrip rather than give it some intergers. This file is required to operate the ledstrip to begin with.
therefore it is a rather large file with a full documentation on `github <https://github.com/adafruit/Adafruit_NeoPixel>`_.
.. collapse:: notes
This code contains all the technical functions of the ledstrip setup. The interesting part for the user are functinos such as "brightness", "show" and "rotate". Whereas
colorwave gave the user the colors for the ledstrip, Neopixel gives the user all the fun functions to create your own custom lighting.
discolight_sl: This is the main file i'm currently using to stash all my functions in. For the moment this only includes some code i got from some `guy <https://git.herreweb.nl/EljakimHerrewijnen>`_
called disco. My own code which is called police and a shutoff function. Because i'm too lazy to scroll for the functions i call them in a different file.
.. collapse:: Notes
This code has very few interesting notes, In the function: "discolight" we use a randomizer to set every pixel to some random rgb value. In the function :"police"
we use a clever calculation to get the even numbers for one set of leds and the very same formula to get the uneven leds. After that we simply make the leds take turns
in who gets to light up first, creating a policelight effect.
This code is a work in progress and will be continued in due time.