|
45 | 45 | "During this practical, you will be creating your own version of this game on the ALPACA. As the ALPACA does not have moles or a mallet, you will replace the moles with LEDs and the mallet with buttons. You will programme the LEDs to turn on at random and will use the buttons to turn the LEDs off, analogous to how the mallet is used to hit the moles in the arcade game. \n", |
46 | 46 | "\n", |
47 | 47 | "(Task_B2)=\n", |
48 | | - "#### Task B2: LEDs\n", |
| 48 | + "#### Task B2: Light emitting diodes (LEDs)\n", |
49 | 49 | "A light emitting diode (LED) is a type of directional component that converts electricity into light. You will dive deeper into the concept of diodes and LEDs in future practicals, but for today, it is only important that you understand how to connect an LED. As seen in the figure below, to conduct electricity and emit light, the long leg of the LED (also referred to as the anode), should be connected to a higher potential than the short leg (also referred to as the cathode).\n", |
50 | 50 | "\n", |
51 | 51 | "```{figure} images/LED.svg\n", |
|
55 | 55 | "---\n", |
56 | 56 | "How to connect an LED\n", |
57 | 57 | "```\n", |
58 | | - "As seen in the figure below, the ALPACA has four LEDs. These will act as our moles in our version of Whack-a-mole. The letter A next to the name of each LED represents the anode of the LED and the letter C indicates the cathode.\n", |
| 58 | + "As seen in the figure below, the ALPACA has four LEDs. These will act as the moles in your version of Whack-a-mole. The letter A next to the name of each LED represents the anode of the LED and the letter C indicates the cathode.\n", |
59 | 59 | "\n", |
60 | 60 | "```{figure} images/LEDs_ALPACA.png\n", |
61 | 61 | "---\n", |
|
77 | 77 | "For example, pin 14 on the Pico-Pi is a digital output pin and pin 19 is a digital input pin. In the code cell below, you can see how these pins can be defined and programmed. \n", |
78 | 78 | "\n", |
79 | 79 | "```{note}\n", |
80 | | - "The names Dout1 and Din1 were selected, as they are easy to remember. You can assign different names to pins. \n", |
| 80 | + "The names Dout1 and Din1 were selected, as they are easy to remember. You can assign different names to the pins. \n", |
81 | 81 | "```" |
82 | 82 | ] |
83 | 83 | }, |
|
106 | 106 | "source": [ |
107 | 107 | "(Task_B4)=\n", |
108 | 108 | "#### Task B4: Switches and pull-up/pull-down resistors\n", |
109 | | - "Analogous to the mallet which is used to hit the moles in the Whack-a-mole game, we will use buttons/switches to turn off the LEDs. A switch is a valuable electronic component which can be used to close or open a path for current flow. \n", |
| 109 | + "Analogous to the mallet which is used to hit the moles in the Whack-a-mole game, you will use switches to turn off the LEDs. A switch is a valuable electronic component which can be used to close or open a path for current flow. A button is a special type of switch that works when pushed. \n", |
110 | 110 | "\n", |
| 111 | + "As seen in the figure below, the ALPACA has four buttons.\n", |
111 | 112 | "\n", |
112 | | - "The ALPACA has four switches. " |
| 113 | + "```{figure} images/switches_ALPACA.png\n", |
| 114 | + "---\n", |
| 115 | + "width: 300px\n", |
| 116 | + "name: Schematic of switches on the ALPACA\n", |
| 117 | + "---\n", |
| 118 | + "Schematic of switches on the ALPACA\n", |
| 119 | + "```\n", |
| 120 | + "As you can see in this figure, the circuit containing the button also contains a 10 kΩ resistor. \n", |
| 121 | + "\n", |
| 122 | + "We have two different options for how we can connect the button with respect to the resistor. \n", |
| 123 | + "\n" |
113 | 124 | ] |
114 | 125 | } |
115 | 126 | ], |
|
0 commit comments