This week we got to play with our breadboards a little more, aswell as take a look at some basic sample code to help us get a better understanding of input, output, and the inner workings of our arduino. Our first step was wire up a simple LED and to upload our sample code to our arduino to get a better physical understanding of how the code loops through, making our LED blink on and off every second. Our next step was to properly wire in seven more LED's, using seperate pins from our arduino for each LED as to control each LED in a certain way, as you can see from the video below. I thought it was very interesting how the code was set up to run certain loops for only certain amounts of time using for(int i=0, i < 8; i++) which would cause the loop to repeat eight times.
Our next step was to set up a small motor we were provided with. This required the use of a transistor in order to provide enough current for our motor. We did experience several problems when trying to provide power for our motor. We added a small breadboard on the right hand side of our original breadboard on the first day of lab and it turns out that not all of the vertical sections of the added breadboard are connected to one another. We simply had to make sure that our pins were all plugged into the same section of the breadboard.
The next part of our lab was to wire up another LED, but one that could be turned on and off via pushbutton. This section of lab allowed us to focus more on how inputs worked instead of just outputs. We learned more about how the arduino detects for the voltage of a pin to sense whether a button is pressed or not. For example, in this picture the arduino detects the pin to be LOW.
And in this picture it is detected to be HIGH.
No comments:
Post a Comment