{"id":355,"date":"2020-04-17T17:56:09","date_gmt":"2020-04-17T17:56:09","guid":{"rendered":"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/?page_id=355"},"modified":"2021-03-11T16:59:27","modified_gmt":"2021-03-11T16:59:27","slug":"pcomp-workshop","status":"publish","type":"page","link":"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/pcomp-workshop\/","title":{"rendered":"Physical Computing Workshop"},"content":{"rendered":"<p><strong><em>We will learn how to build circuits and how to program an\u00a0<\/em><\/strong><strong><em>Arduino microcontroller.<\/em><\/strong><\/p>\n<h3><strong>FIRST LOOK AT A MICROCONTROLLER: THE ARDUINO UNO<\/strong><\/h3>\n<p>A <strong>microcontroller<\/strong> is a small computer that can take in information from inputs such as sensors and switches and control outputs such as lights, motors and other computers. Microcontrollers are widely used in many different ways; DIY and robotics, art installations, industrial applications, and the internet of things.<\/p>\n<p>When you are using a microcontroller, or in our case a microcontroller platform, there are two components: <strong>hardware<\/strong> and <strong>software<\/strong>. The hardware includes the microcontroller and its input and output pins, and any input or output devices you want to attach to it. The software is programs you write that control the microcontroller and the devices you have attached to it.<\/p>\n<p>We will be using the Arduino microcontroller platform. It was developed by a team of teachers to help their design students who were not engineers create physical interfaces. There are many different Arduinos, and clones as well. We will be using the Uno.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-411 aligncenter\" src=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_01.png\" alt=\"\" width=\"400\" height=\"300\" srcset=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_01.png 400w, https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_01-300x225.png 300w\" sizes=\"auto, (max-width: 400px) 85vw, 400px\" \/><\/p>\n<h3>ATTACH AN ARDUINO TO A COMPUTER<\/h3>\n<p>To do this, you will need a computer, and Arduino Uno and a USB cable. The Arduino Uno<br \/>uses a USB A-B cable, while some clones of the Arduino use a USB micro cable.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-412 aligncenter\" src=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_02.png\" alt=\"\" width=\"505\" height=\"250\" srcset=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_02.png 505w, https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_02-300x149.png 300w\" sizes=\"auto, (max-width: 505px) 85vw, 505px\" \/><\/p>\n<h3>LAUNCH THE ARDUINO SOFTWARE<\/h3>\n<p>The laptops in the Makerspace have the Arduino software, or IDE (integrated development environment) installed. An IDE, or integrated development environment, is a software application that allows you to write code and test that code out in the programming language the IDE supports.<\/p>\n<p>If you are using your own computer, you can download the <a href=\"http:\/\/arduino.cc\/en\/Main\/Software\"><em><strong>Arduino IDE here<\/strong><\/em><\/a>. The software is open-source and distributed free of charge.<\/p>\n<p>The procedure for downloading and installing the software is slightly different for Macs and Windows. <em><strong><a href=\"http:\/\/arduinotogo.com\/2016\/09\/09\/chapter-3-downloading-and-installing-the-software\/\">Detailed instructions for both platforms are here.<\/a><\/strong><\/em><\/p>\n<p>SETTING UP THE SOFTWARE<\/p>\n<p>Before we start programming the Arduino, we have to set a couple of settings in the software to ensure that the Arduino can communicate with the computer.<\/p>\n<p><strong>Launch the Arduino software<\/strong>. Once it is loaded, go to the <strong>Tools<\/strong> menu, select <strong>Board<\/strong>. From the fly out menu, select<strong> Arduino\/Genuino Uno<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-413\" src=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_03.png\" alt=\"\" width=\"608\" height=\"400\" srcset=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_03.png 608w, https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_03-300x197.png 300w\" sizes=\"auto, (max-width: 608px) 85vw, 608px\" \/><\/p>\n<p>Next, it is necessary to specify a <strong>Serial Port<\/strong> for your Arduino to communicate with the computer. A <strong>Port<\/strong> is a channel of communication which connects your Arduino and the computer. On a Windows machine, go to the <strong>Tools Menu<\/strong>, select <strong>Port<\/strong> then select the <strong>COM port<\/strong> that is specified. It should look something like the screenshot below.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-414\" src=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_04.png\" alt=\"\" width=\"562\" height=\"308\" srcset=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_04.png 562w, https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_04-300x164.png 300w\" sizes=\"auto, (max-width: 562px) 85vw, 562px\" \/><\/p>\n<p>PROGRAMMING THE ARDUINO<\/p>\n<p>The Arduino team has designed an IDE for use with their devices that has the features you need. It has a built-in code editor, which is a program used to write the code files that you create when programming. You can test your code in the IDE and solve problems with the help of a message area that shows errors in your code and a console that provides more detail about the nature of these errors. It has buttons so you can check your code, save it, create a new code window, upload it to your Arduino and more. The basic unit of Arduino programming is called a <strong>Sketch<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-415\" src=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_05.png\" alt=\"\" width=\"425\" height=\"436\" srcset=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_05.png 425w, https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_05-292x300.png 292w\" sizes=\"auto, (max-width: 425px) 85vw, 425px\" \/><\/p>\n<h3>LOAD A SKETCH AND SAVE AS<\/h3>\n<p>With the Arduino IDE open, go to the <strong>File Menu &gt; Examples &gt; 01.Basics &gt; Blink<\/strong>. This will open up the <strong>Blink Sketch<\/strong>. It\u2019s always a good idea to save a sketch with a new name, you don\u2019t want to write over the example sketch. Save it as Blink_2, for example.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-416\" src=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_06.png\" alt=\"\" width=\"425\" height=\"205\" srcset=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_06.png 425w, https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_06-300x145.png 300w\" sizes=\"auto, (max-width: 425px) 85vw, 425px\" \/><\/p>\n<p>VERIFY AND UPLOAD BLINK SKETCH<\/p>\n<p>Once you have saved the sketch, click the Verify button to make sure it is ok. While it is highly unlikely anything would be wrong when you are loading a copy of one of the example files, it\u2019s good to be in the habit of checking. After you verify, click the Upload button. This will load your code on to the Arduino board.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-417\" src=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_07.png\" alt=\"\" width=\"720\" height=\"320\" srcset=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_07.png 720w, https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_07-300x133.png 300w\" sizes=\"auto, (max-width: 720px) 85vw, 720px\" \/><\/p>\n<p>You will see an LED that is located near Pin 13 on the Arduino board blink on and off. What if it doesn\u2019t? Check to make sure your Arduino is plugged into the computer. Check to make sure you have set the correct Board and Port settings.<\/p>\n<h3>BUILDING A CIRCUIT: THE BREADBOARD<\/h3>\n<p>Let\u2019s build a circuit so we can blink an LED that is <strong>NOT<\/strong> built into our Arduino. Meet the <strong>breadboard<\/strong>. Breadboards were developed to make it easy to quickly prototype circuits without soldering components together. They have rows and columns of connected holes that allow us to attach our components to each other.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-418\" src=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_08.png\" alt=\"\" width=\"850\" height=\"450\" srcset=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_08.png 850w, https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_08-300x159.png 300w, https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_08-768x407.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<h3>CONNECT THE UNO TO THE BREADBOARD<\/h3>\n<p>Make sure your Arduino is not plugged in to the computer. <strong>Whenever you are making changes to a circuit, your Arduino should NOT be plugged in.<\/strong><\/p>\n<p>Grab a couple of jumper wires. You are going to connect the Arduino to the breadboard. It is a convention to use\u00a0<strong>RED<\/strong>\u00a0for power and <strong>BLACK<\/strong> for ground. Put one end of the black wire into one of the pins marked <strong>GND<\/strong> on the Arduino and the red wire into the pin marked <strong>5V on the Arduino<\/strong>.<\/p>\n<p>Put the other end of the <strong>BLACK wire<\/strong> into the <strong>ground bus on the breadboard<\/strong>. It probably has a green or blue minus (-) sign near it. The other end of the <strong>RED wire<\/strong> goes into the<strong> power bus on the breadboard<\/strong>, which has a red plus (+) sign above it.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-431 size-full\" src=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_09.png\" alt=\"\" width=\"500\" height=\"450\" srcset=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_09.png 500w, https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_09-300x270.png 300w\" sizes=\"auto, (max-width: 500px) 85vw, 500px\" \/><\/p>\n<h3>ATTACH PIN 13 TO THE BREADBOARD<\/h3>\n<p>Grab a jumper and attach PIN 13 to a row of tie-points in the breadboard.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-420 size-full\" src=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_10.png\" alt=\"\" width=\"534\" height=\"376\" \/><\/p>\n<h3>ADD A 220 OHM RESISTOR<\/h3>\n<p>\u00a0<\/p>\n<p>Place one end of a 220 Ohm resistor in the same row of tie-points as the jumper from pin 13, and the other end in a different row of tie-points.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-421 size-full\" src=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_11.png\" alt=\"\" width=\"565\" height=\"320\" \/><\/p>\n<h3>ADD THE LED<\/h3>\n<p>Now let\u2019s add an LED to the breadboard.<\/p>\n<p>An<strong> LED (light emitting diode)<\/strong> has an orientation, or a <strong>positive<\/strong> and <strong>negative<\/strong> lead. An LED must be placed into a circuit properly, with the positive and negative lead oriented properly. How do you know what is the positive and negative side? The positive side has a longer lead. It is called the anode. The negative lead is shorter and called the cathode. Also, the negative side of an LED often has a flatter side at the bulb.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-423\" src=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_13.png\" alt=\"\" width=\"250\" height=\"260\" \/><\/p>\n<p>Place the anode (long end) of the resistor in the same row of tie-points as one end of the resistor, and the cathode (short end) into another row.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-434 size-full\" src=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_12.png\" alt=\"\" width=\"662\" height=\"310\" srcset=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_12.png 662w, https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_12-300x140.png 300w\" sizes=\"auto, (max-width: 662px) 85vw, 662px\" \/><\/p>\n<p>JUMP THE CIRCUIT BACK TO GROUND<\/p>\n<p>The final step to complete the circuit is to attach a jumper from the cathode of the LED to the ground bus on the breadboard<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-436 size-full\" src=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_14.png\" alt=\"\" width=\"600\" height=\"275\" srcset=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_14.png 600w, https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_14-300x138.png 300w\" sizes=\"auto, (max-width: 600px) 85vw, 600px\" \/><\/p>\n<h3>PLUG IT IN AND RUN BLINK<\/h3>\n<p>You\u2019ve completed the circuit! If you plug the Uno back into your computer, the LED should be blinking. Why does it run when we haven\u2019t changed the code?<\/p>\n<p>And what if it isn\u2019t blinking? Carefully check all the connections you have made with the components and jumpers.<\/p>\n<h3>ADD A BUTTON<\/h3>\n<p>Let\u2019s make this circuit more interactive and add a button. We will leave the LED, resistor and buttons right where they are. <strong>Be sure to unplug the Arduino from the computer before you make changes!<\/strong><\/p>\n<p>Place a momentary switch over the trench in the bottom of the breadboard. The button\u2019s pins should be placed so there are two pins on either side of the trench.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-437\" src=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_15.png\" alt=\"\" width=\"556\" height=\"332\" srcset=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_15.png 556w, https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_15-300x179.png 300w\" sizes=\"auto, (max-width: 556px) 85vw, 556px\" \/><\/p>\n<h3>CONNECT BUTTON TO POWER BUS<\/h3>\n<p>Add a jumper that connects the power bus to one side of the button.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-438\" src=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_16.png\" alt=\"\" width=\"600\" height=\"268\" srcset=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_16.png 600w, https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_16-300x134.png 300w\" sizes=\"auto, (max-width: 600px) 85vw, 600px\" \/><\/p>\n<h3>ADD A 10K RESISTOR<\/h3>\n<p>Place a 10K resistor in the breadboard, with one end in the ground bus and the other end attached to the other pin of the button.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-439\" src=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_17.png\" alt=\"\" width=\"532\" height=\"264\" srcset=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_17.png 532w, https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_17-300x149.png 300w\" sizes=\"auto, (max-width: 532px) 85vw, 532px\" \/><\/p>\n<h3>ATTACH PIN 2 TO BUTTON AND RESISTOR<\/h3>\n<p>Place one end of a jumper in pin 2 and the other end in the same row of tie-points as the 10k resistor and one of the pins of the button.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-441\" src=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_18.png\" alt=\"\" width=\"1064\" height=\"430\" srcset=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_18.png 1064w, https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_18-300x121.png 300w, https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_18-768x310.png 768w, https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_18-1024x414.png 1024w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p>You\u2019ve completed the circuit. Now attach the Arduino to your computer. In the Arduino IDE, open from the <strong>File Menu &gt; Examples &gt; 02.Digital &gt; Button<\/strong>. Save as, with a name like MyButton.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-442\" src=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_19.png\" alt=\"\" width=\"900\" height=\"266\" srcset=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_19.png 900w, https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_19-300x89.png 300w, https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_19-768x227.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p>Now when you press the button, the LED will light up. If it doesn\u2019t, carefully check all of your connections.<\/p>\n<h2>ANALOG INPUT AND OUTPUT<\/h2>\n<p>We\u2019ve learned how to turn something on or off with a button, but sometimes you want more. How about controlling the brightness of the LED? Let\u2019s learn how to use <strong>analog input<\/strong> and <strong>output<\/strong>. We will use a <strong>potentiometer<\/strong>.<\/p>\n<p>A potentiometer, sometimes called a pot, is a knob or dial that can be turned to increase or decrease the amount of resistance depending on how far, and in which direction, it is turned. Potentiometers come in many sizes and shapes. We will be using a <strong>10k ohm potentiometer<\/strong> in our circuit.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-443\" src=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_20.png\" alt=\"\" width=\"400\" height=\"325\" srcset=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_20.png 400w, https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_20-300x244.png 300w\" sizes=\"auto, (max-width: 400px) 85vw, 400px\" \/><\/p>\n<h3>MOVE THE JUMPER TO PIN 9<\/h3>\n<p>We will start with the same basic circuit. If you still have the button in the breadboard, remove it as well as the jumpers and resistor. Also, <strong>move the jumper attached to the resistor from Pin 13 to Pin 9<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-444\" src=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_21.png\" alt=\"\" width=\"950\" height=\"400\" srcset=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_21.png 950w, https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_21-300x126.png 300w, https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_21-768x323.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<h3>ADD THE POTENTIOMETER<\/h3>\n<p>We will place the potentiometer parallel to the trench as depicted in the drawing. Each pin of the potentiometer is in a separate row of tie points, with an empty tie point between each of the pins.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-445\" src=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_22.png\" alt=\"\" width=\"640\" height=\"566\" srcset=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_22.png 640w, https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_22-300x265.png 300w\" sizes=\"auto, (max-width: 640px) 85vw, 640px\" \/><\/p>\n<h3>CONNECT THE POTENTIOMETER TO POWER AND GROUND<\/h3>\n<p>With a jumper,, attach the pin at one end of the potentiometer to the power bus. Attach the pin at the other end of the potentiometer to the ground bus.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-446\" src=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_23.png\" alt=\"\" width=\"682\" height=\"400\" srcset=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_23.png 682w, https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_23-300x176.png 300w\" sizes=\"auto, (max-width: 682px) 85vw, 682px\" \/><\/p>\n<h3>ATTACH THE MIDDLE PIN OF THE POT TO PIN A0<\/h3>\n<p>Finally, attach the middle pin of the potentiometer to Pin A0, which is on the other side of the Arduino Uno as shown in the drawing.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-447\" src=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_24.png\" alt=\"\" width=\"825\" height=\"400\" srcset=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_24.png 825w, https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_24-300x145.png 300w, https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-content\/uploads\/sites\/144\/2020\/04\/pcomp_24-768x372.png 768w\" sizes=\"auto, (max-width: 825px) 85vw, 825px\" \/><\/p>\n<h3>ATTACH YOUR COMPUTER AND UPLOAD THE SKETCH<\/h3>\n<p>After connecting your computer to the Arduino, in the IDE, navigate to <strong>File Menu &gt; Examples &gt; 03.Analog &gt; AnalogInOutSerial<\/strong>. You might want to Save As, MyAnalogInOutSerial, for example.<\/p>\n<p>Now when you turn the potentiometer, your LED should have a full range of brightness, from unlit to fully bright.<\/p>\n<p>You are curious about learning more about circuits and the Arduino, you can visit our page on <a href=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/pcomp\/\"><strong>Physical Computing<\/strong><\/a> for more information and links.<\/p>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We will learn how to build circuits and how to program an\u00a0Arduino microcontroller. FIRST LOOK AT A MICROCONTROLLER: THE ARDUINO UNO A microcontroller is a small computer that can take in information from inputs such as sensors and switches and control outputs such as lights, motors and other computers. Microcontrollers are widely used in many &hellip; <a href=\"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/pcomp-workshop\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Physical Computing Workshop&#8221;<\/span><\/a><\/p>\n","protected":false},"author":184,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"portfolio_post_id":0,"portfolio_citation":"","portfolio_annotation":"","openlab_post_visibility":"","footnotes":""},"class_list":["post-355","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-json\/wp\/v2\/pages\/355","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-json\/wp\/v2\/users\/184"}],"replies":[{"embeddable":true,"href":"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-json\/wp\/v2\/comments?post=355"}],"version-history":[{"count":6,"href":"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-json\/wp\/v2\/pages\/355\/revisions"}],"predecessor-version":[{"id":1722,"href":"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-json\/wp\/v2\/pages\/355\/revisions\/1722"}],"wp:attachment":[{"href":"https:\/\/openlab.bmcc.cuny.edu\/makerspace\/wp-json\/wp\/v2\/media?parent=355"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}