diff --git a/misc/PullUpWiderstand.kicad_sch b/misc/PullUpWiderstand.kicad_sch new file mode 100644 index 0000000..d2e4a6e --- /dev/null +++ b/misc/PullUpWiderstand.kicad_sch @@ -0,0 +1,1207 @@ +(kicad_sch + (version 20231120) + (generator "eeschema") + (generator_version "8.0") + (uuid "010a0f2a-cf19-430b-ad46-7851a0b6c63a") + (paper "A4") + (lib_symbols + (symbol "PCM_Elektuur:S-make" + (pin_numbers hide) + (pin_names + (offset 0) hide) + (exclude_from_sim no) + (in_bom yes) + (on_board yes) + (property "Reference" "S" + (at 1.27 3.175 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + ) + ) + (property "Value" "S-make" + (at 1.27 -3.175 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + ) + ) + (property "Footprint" "" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Datasheet" "" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Description" "make/closing contact; switch, single pole, single throw, normally open (SPST-NO/A)" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Sim.Pins" "3=1 3=2 3=3 4=4 4=5 4=6" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Sim.Device" "SPICE" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Sim.Params" "X" + (at 1.27 0 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + (hide yes) + ) + ) + (property "Rating" "V/A" + (at -1.27 -3.175 0) + (effects + (font + (size 1.27 1.27) + ) + (justify right) + (hide yes) + ) + ) + (property "ki_keywords" "S X make closing contact switch single pole throw normally open SPST-NO A" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (symbol "S-make_1_1" + (circle + (center 0 -2.2606) + (radius 0.5334) + (stroke + (width 0.3556) + (type default) + ) + (fill + (type outline) + ) + ) + (polyline + (pts + (xy -2.8956 2.413) (xy -0.381 -2.0574) (xy 0.0254 -1.8288) (xy -2.4892 2.6416) (xy -2.8956 2.413) + ) + (stroke + (width 0.254) + (type default) + ) + (fill + (type outline) + ) + ) + (circle + (center 0 2.2606) + (radius 0.5334) + (stroke + (width 0.3556) + (type default) + ) + (fill + (type none) + ) + ) + (pin passive line + (at 0 -5.08 90) + (length 2.2352) + (name "3" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (number "3" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + ) + (pin passive line + (at 0 5.08 270) + (length 2.2352) + (name "4" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (number "4" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + ) + ) + (symbol "S-make_1_2" + (circle + (center 0 -2.032) + (radius 0.5334) + (stroke + (width 0.3556) + (type default) + ) + (fill + (type outline) + ) + ) + (polyline + (pts + (xy -0.3556 -1.8796) (xy 0.0508 -1.651) (xy -2.2352 2.413) (xy -2.6416 2.1844) (xy -0.3556 -1.8796) + ) + (stroke + (width 0.254) + (type default) + ) + (fill + (type outline) + ) + ) + (circle + (center 0 2.032) + (radius 0.5334) + (stroke + (width 0.3556) + (type default) + ) + (fill + (type none) + ) + ) + (pin passive line + (at 0 -5.08 90) + (length 2.4638) + (name "3" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (number "3" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + ) + (pin passive line + (at 0 5.08 270) + (length 2.4638) + (name "4" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (number "4" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + ) + ) + (symbol "S-make_1_3" + (circle + (center 0 -2.2606) + (radius 0.5334) + (stroke + (width 0.3556) + (type default) + ) + (fill + (type outline) + ) + ) + (polyline + (pts + (xy -0.3556 -2.1082) (xy 0.0508 -1.8796) (xy -2.2352 2.1844) (xy -2.6416 1.9558) (xy -0.3556 -2.1082) + ) + (stroke + (width 0.254) + (type default) + ) + (fill + (type outline) + ) + ) + (circle + (center 0 2.2606) + (radius 0.5334) + (stroke + (width 0.3556) + (type default) + ) + (fill + (type none) + ) + ) + (pin passive line + (at 0 -5.08 90) + (length 2.2352) + (name "3" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (number "3" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + ) + (pin passive line + (at 0 5.08 270) + (length 2.2352) + (name "4" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (number "4" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + ) + ) + ) + (symbol "PCM_Generic:P,+3.3" + (power) + (pin_numbers hide) + (pin_names + (offset 1.27) hide) + (exclude_from_sim no) + (in_bom yes) + (on_board yes) + (property "Reference" "#PWR" + (at 2.54 0 0) + (effects + (font + (size 2.54 2.54) + ) + (justify left) + (hide yes) + ) + ) + (property "Value" "P,+3.3" + (at 0 2.54 0) + (effects + (font + (size 0.001 0.001) + ) + (justify bottom) + (hide yes) + ) + ) + (property "Footprint" "" + (at 0 0 0) + (effects + (font + (size 2.54 2.54) + ) + (hide yes) + ) + ) + (property "Datasheet" "" + (at 0 0 0) + (effects + (font + (size 2.54 2.54) + ) + (hide yes) + ) + ) + (property "Description" "+3.3 positive potential/voltage (global DC power supply node)" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "ki_keywords" "P V + +3.3 3.3 positive potential voltage tension global DC power supply node label pin equipotential bonding" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (symbol "P,+3.3_1_1" + (polyline + (pts + (xy 0 0) (xy 0 1.8288) + ) + (stroke + (width 0) + (type default) + ) + (fill + (type none) + ) + ) + (polyline + (pts + (xy -1.0668 0) (xy 0 1.8288) (xy 1.0668 0) + ) + (stroke + (width 0) + (type default) + ) + (fill + (type none) + ) + ) + (text "+3.3" + (at 0 2.54 0) + (effects + (font + (size 2.54 2.54) + ) + (justify bottom) + ) + ) + (pin power_in line + (at 0 0 0) + (length 0) hide + (name "+3.3" + (effects + (font + (size 2.54 2.54) + ) + ) + ) + (number "0" + (effects + (font + (size 0 0) + ) + ) + ) + ) + ) + ) + (symbol "PCM_Generic:P,0" + (power) + (pin_numbers hide) + (pin_names + (offset 3.81) + ) + (exclude_from_sim no) + (in_bom yes) + (on_board yes) + (property "Reference" "#PWR" + (at 3.81 3.81 0) + (effects + (font + (size 2.54 2.54) + ) + (justify left) + (hide yes) + ) + ) + (property "Value" "P,0" + (at 3.81 0 0) + (effects + (font + (size 0.001 0.001) + ) + (justify left) + (hide yes) + ) + ) + (property "Footprint" "" + (at 0 0 0) + (effects + (font + (size 2.54 2.54) + ) + (hide yes) + ) + ) + (property "Datasheet" "" + (at 0 0 0) + (effects + (font + (size 2.54 2.54) + ) + (hide yes) + ) + ) + (property "Description" "global node 0; simplified functional (equipotential) bonding (FB); simplified frame/chassis" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "ki_keywords" "P V 0 GND FB equipotential bonding earth earthing ground grounding simplified frame chassis potential voltage tension global DC power supply node label pin" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (symbol "P,0_1_1" + (polyline + (pts + (xy -2.54 0) (xy 2.54 0) + ) + (stroke + (width 0.508) + (type default) + ) + (fill + (type none) + ) + ) + (pin power_in line + (at 0 0 0) + (length 0) hide + (name "0" + (effects + (font + (size 2.54 2.54) + ) + ) + ) + (number "0" + (effects + (font + (size 0 0) + ) + ) + ) + ) + ) + ) + (symbol "PCM_SL_Pin_Headers:PINHD_1x1_Male" + (exclude_from_sim no) + (in_bom yes) + (on_board yes) + (property "Reference" "J" + (at 0 6.35 0) + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (property "Value" "PINHD_1x1_Male" + (at 0 3.81 0) + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (property "Footprint" "Connector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_Vertical" + (at 1.27 -2.54 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Datasheet" "" + (at 0 6.35 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Description" "Pin Header male with pin space 2.54mm. Pin Count -1" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "ki_keywords" "Pin Header" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "ki_fp_filters" "Connector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm*" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (symbol "PINHD_1x1_Male_0_1" + (rectangle + (start -1.27 1.27) + (end 1.27 -1.27) + (stroke + (width 0) + (type default) + ) + (fill + (type background) + ) + ) + (polyline + (pts + (xy -1.27 0) (xy 0 0) + ) + (stroke + (width 0.3) + (type default) + ) + (fill + (type none) + ) + ) + (polyline + (pts + (xy -1.27 0) (xy 0 0) + ) + (stroke + (width 0.5) + (type default) + ) + (fill + (type none) + ) + ) + ) + (symbol "PINHD_1x1_Male_1_1" + (pin passive line + (at -3.81 0 0) + (length 2.54) + (name "" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (number "1" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + ) + ) + ) + (symbol "PCM_SL_Resistors:Resistor" + (exclude_from_sim no) + (in_bom yes) + (on_board yes) + (property "Reference" "R" + (at 0 5.08 0) + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (property "Value" "Resistor" + (at 0 2.54 0) + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (property "Footprint" "Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal" + (at 0.889 -4.318 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Datasheet" "" + (at 0.508 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Description" "1/4W Resistor" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "ki_keywords" "Resistor" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "ki_fp_filters" "Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm*" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (symbol "Resistor_0_1" + (rectangle + (start -2.286 0.889) + (end 2.286 -0.889) + (stroke + (width 0.24) + (type default) + ) + (fill + (type none) + ) + ) + ) + (symbol "Resistor_1_1" + (pin passive line + (at -3.81 0 0) + (length 1.5) + (name "" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (number "1" + (effects + (font + (size 0 0) + ) + ) + ) + ) + (pin passive line + (at 3.81 0 180) + (length 1.5) + (name "~" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (number "2" + (effects + (font + (size 0 0) + ) + ) + ) + ) + ) + ) + ) + (junction + (at 83.82 46.99) + (diameter 0) + (color 0 0 0 0) + (uuid "6fc3c276-6af6-4d31-8c96-132131fe2450") + ) + (wire + (pts + (xy 83.82 60.96) (xy 83.82 63.5) + ) + (stroke + (width 0) + (type default) + ) + (uuid "018b5cca-480f-4695-9664-18e715a6152c") + ) + (wire + (pts + (xy 83.82 46.99) (xy 90.17 46.99) + ) + (stroke + (width 0) + (type default) + ) + (uuid "39da6c99-01a8-4f63-a658-9323f0ba7682") + ) + (wire + (pts + (xy 83.82 41.91) (xy 83.82 46.99) + ) + (stroke + (width 0) + (type default) + ) + (uuid "578682bf-f149-4f84-a6ae-250565547f12") + ) + (wire + (pts + (xy 83.82 46.99) (xy 83.82 50.8) + ) + (stroke + (width 0) + (type default) + ) + (uuid "6249429a-a85e-4da4-aa6d-52d6378bd6f8") + ) + (wire + (pts + (xy 83.82 30.48) (xy 83.82 34.29) + ) + (stroke + (width 0) + (type default) + ) + (uuid "b1168a67-233d-46c1-95fb-70d9c7710013") + ) + (symbol + (lib_id "PCM_Generic:P,+3.3") + (at 83.82 30.48 0) + (unit 1) + (exclude_from_sim no) + (in_bom yes) + (on_board yes) + (dnp no) + (fields_autoplaced yes) + (uuid "1e8ec80d-4366-481c-b67c-645043a87f75") + (property "Reference" "#PWR01" + (at 86.36 30.48 0) + (effects + (font + (size 2.54 2.54) + ) + (justify left) + (hide yes) + ) + ) + (property "Value" "P,+3.3" + (at 83.82 27.94 0) + (effects + (font + (size 0.001 0.001) + ) + (justify bottom) + (hide yes) + ) + ) + (property "Footprint" "" + (at 83.82 30.48 0) + (effects + (font + (size 2.54 2.54) + ) + (hide yes) + ) + ) + (property "Datasheet" "" + (at 83.82 30.48 0) + (effects + (font + (size 2.54 2.54) + ) + (hide yes) + ) + ) + (property "Description" "+3.3 positive potential/voltage (global DC power supply node)" + (at 83.82 30.48 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (pin "0" + (uuid "9cf1f902-753b-41eb-87ec-e474068802e2") + ) + (instances + (project "" + (path "/010a0f2a-cf19-430b-ad46-7851a0b6c63a" + (reference "#PWR01") + (unit 1) + ) + ) + ) + ) + (symbol + (lib_id "PCM_SL_Pin_Headers:PINHD_1x1_Male") + (at 93.98 46.99 0) + (unit 1) + (exclude_from_sim no) + (in_bom yes) + (on_board yes) + (dnp no) + (fields_autoplaced yes) + (uuid "33835b67-806e-4bf5-b6f5-9e9ff05e6b8c") + (property "Reference" "EingangMikrocontroller" + (at 96.52 46.3549 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + ) + ) + (property "Value" "~" + (at 96.52 48.26 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + ) + ) + (property "Footprint" "Connector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_Vertical" + (at 95.25 49.53 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Datasheet" "" + (at 93.98 40.64 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Description" "Pin Header male with pin space 2.54mm. Pin Count -1" + (at 93.98 46.99 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (pin "1" + (uuid "994946d0-a1c6-4866-9675-f633cb593bfa") + ) + (instances + (project "" + (path "/010a0f2a-cf19-430b-ad46-7851a0b6c63a" + (reference "EingangMikrocontroller") + (unit 1) + ) + ) + ) + ) + (symbol + (lib_id "PCM_Elektuur:S-make") + (at 83.82 55.88 0) + (unit 1) + (exclude_from_sim no) + (in_bom yes) + (on_board yes) + (dnp no) + (fields_autoplaced yes) + (uuid "7944eb49-3d5f-4b4f-a681-ffb843a90dd5") + (property "Reference" "FlashKnopf" + (at 86.36 55.2449 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + ) + ) + (property "Value" "~" + (at 86.36 57.15 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + ) + ) + (property "Footprint" "" + (at 83.82 55.88 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Datasheet" "" + (at 83.82 55.88 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Description" "make/closing contact; switch, single pole, single throw, normally open (SPST-NO/A)" + (at 83.82 55.88 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Field-1" "X" + (at 85.09 55.88 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + (hide yes) + ) + ) + (property "Rating" "V/A" + (at 82.55 59.055 0) + (effects + (font + (size 1.27 1.27) + ) + (justify right) + (hide yes) + ) + ) + (pin "4" + (uuid "9771e9f2-7155-4bd6-b66d-c889a6675e89") + ) + (pin "3" + (uuid "d88f471e-3124-4b7f-8d07-aab6f6ca8851") + ) + (instances + (project "" + (path "/010a0f2a-cf19-430b-ad46-7851a0b6c63a" + (reference "FlashKnopf") + (unit 1) + ) + ) + ) + ) + (symbol + (lib_id "PCM_Generic:P,0") + (at 83.82 63.5 0) + (unit 1) + (exclude_from_sim no) + (in_bom yes) + (on_board yes) + (dnp no) + (fields_autoplaced yes) + (uuid "b38519e5-22f2-4606-8424-ec7218544333") + (property "Reference" "#PWR02" + (at 87.63 59.69 0) + (effects + (font + (size 2.54 2.54) + ) + (justify left) + (hide yes) + ) + ) + (property "Value" "P,0" + (at 87.63 63.5 0) + (effects + (font + (size 0.001 0.001) + ) + (justify left) + (hide yes) + ) + ) + (property "Footprint" "" + (at 83.82 63.5 0) + (effects + (font + (size 2.54 2.54) + ) + (hide yes) + ) + ) + (property "Datasheet" "" + (at 83.82 63.5 0) + (effects + (font + (size 2.54 2.54) + ) + (hide yes) + ) + ) + (property "Description" "global node 0; simplified functional (equipotential) bonding (FB); simplified frame/chassis" + (at 83.82 63.5 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (pin "0" + (uuid "5f05c4d1-5c3a-4e59-896e-c3fabdebd5b1") + ) + (instances + (project "" + (path "/010a0f2a-cf19-430b-ad46-7851a0b6c63a" + (reference "#PWR02") + (unit 1) + ) + ) + ) + ) + (symbol + (lib_id "PCM_SL_Resistors:Resistor") + (at 83.82 38.1 90) + (unit 1) + (exclude_from_sim no) + (in_bom yes) + (on_board yes) + (dnp no) + (fields_autoplaced yes) + (uuid "ceabd83b-6185-492b-8664-195069283e9e") + (property "Reference" "PullUpWiderstand" + (at 86.36 37.4649 90) + (effects + (font + (size 1.27 1.27) + ) + (justify right) + ) + ) + (property "Value" "~" + (at 86.36 39.37 90) + (effects + (font + (size 1.27 1.27) + ) + (justify right) + ) + ) + (property "Footprint" "Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal" + (at 88.138 37.211 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Datasheet" "" + (at 83.82 37.592 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Description" "1/4W Resistor" + (at 83.82 38.1 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (pin "2" + (uuid "7a67dbc1-7ba2-4e85-9ba0-83acec6ef7c2") + ) + (pin "1" + (uuid "78538a05-79fb-4d96-8092-83a2edba6db7") + ) + (instances + (project "" + (path "/010a0f2a-cf19-430b-ad46-7851a0b6c63a" + (reference "PullUpWiderstand") + (unit 1) + ) + ) + ) + ) + (sheet_instances + (path "/" + (page "1") + ) + ) +) diff --git a/src/01_grundlagen.ipynb b/src/01_grundlagen.ipynb index 859275d..71b42b1 100644 --- a/src/01_grundlagen.ipynb +++ b/src/01_grundlagen.ipynb @@ -593,6 +593,81 @@ " print(\"x ist größer als 5\")" ] }, + { + "cell_type": "markdown", + "id": "b679354e-d020-4654-894d-38daeaa3a0c4", + "metadata": { + "editable": false, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, + "source": [ + "## Pin Zustände einlesen\n", + "\n", + "Als nächstes wollen wir den Zustand von Pins einlesen und eine entsprechende Meldung ausgeben.\n", + "GPIO 0 ist praktischerweise mit den \"FLASH\" Knopf auf der Platine des Mikrocontrollers verbunden, sodass wir für unseren Test keine extra Schaltung aufbauen müssen.\n", + "Als erstes initialisieren wir den Pin als Input Pin." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "41b849d5-8693-4f31-9496-13a903a3e72c", + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "eingabe_pin = machine.Pin(0, machine.Pin.IN, machine.Pin.PULL_UP)\n", + "eingabe_signal = machine.Signal(eingabe_pin, invert=True)" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "245cb3e5-46e4-4fe6-ae54-0df98b41b35f", + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, + "source": [ + "Hier übergeben wir noch einen dritten Parameter an die Pin Funktion.\n", + "Dieser dient dazu, die internen Pull-Up Widerstände des Mikrocontrollers für diesen Eingang zu aktivieren.\n", + "Neben `machine.Pin.PULL_UP` gibt es auch noch `machine.Pin.PULL_DOWN`, falls man Pull-Down Widerstände nutzen möchte.\n", + "Pull-Up und Pull-Down Widerstände sind dazu da, bei geöffnetem Schalter ein eindeutiges Signal an den Mikrocontroller so senden. \n", + "![Pull-Down Widerstand Schaltplan](img/pull-down-resistor.png)\n", + "\n", + "Nun können wir mit der `value()` Methode es `eingabe_pin` Objekts den Wert des Pins auslesen bzw. mit der gleichen Methode des `eingabe_signals` den invertierten Eingang.\n", + "Wir invertieren den Pin in diesem Fall, weil der FLASH Knopf den Eingang des Mikrocontrollers mit Ground (dem Minuspol) verbindet, dadurch wird ein Aus-Signal (0) gelesen wenn der Knopf gedrückt ist.\n", + "Genau wie auch bei dem Umkehren der Zustände der LED ist dies auch bei dem einlesen von Pins durch ein `machine.Signal` möglich. \n", + "**Wichtig:** Die nächste Zeile gibt den Zustand des Pins aus zum Zeitpunkt der Ausführung, ihr müsst den Kopf also schon vor der Ausführung drücken, falls ihr den gedrückten Zustand einlesen wollt." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bf1cd20a-a878-449b-8692-527da8ec7800", + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "print(eingabe_signal.value())" + ] + }, { "cell_type": "markdown", "id": "f46a9e10-24ff-4d7f-a31b-3a1c5d47df61", diff --git a/src/img/pull-down-resistor.png b/src/img/pull-down-resistor.png new file mode 100644 index 0000000..269fc2e Binary files /dev/null and b/src/img/pull-down-resistor.png differ