Arduino Documentation Blog Entry
There are 4 tasks that will be explained on this page:
1. Input devices:
a. Interface a potentiometer analog input to maker UNO board and measure/show its signal in serial monitor Arduino IDE.
b. Interface an LDR to the maker UNO board and measure/show its signal in serial monitor Arduino IDE
2. Output devices:
a. Interface 3 LEDs (Red, Yellow, Green) to maker UNO board and program it to perform something (fade or flash etc)
b. Include the pushbutton on the MakerUno board to start/stop part 2.a. above
For each of the tasks, I will describe:
1. The program/code that I have used and explanation of the code. The code is in writable format (not an image).
2. The sources/references that I used to write the code/program.
3. The problems I encountered and how I fixed them.
4. The evidence that the code/program worked in the form of video of the executed program/code.
Finally, I will describe:
5. My Learning reflection on the overall Arduino programming activities.
1. Input devices: Interface a potentiometer analog input to the maker UNO board and measure/show its signal in serial monitor Arduino IDE.
1. Below are the code/program I have used and the explanation of the code.
2. Below is the hyperlink to the sources/references that I used to write the code/program.
-
3. Below are the problems I have encountered and how I fixed them.
It was difficult to connect the wires as well as run the code as there were errors that constantly popped up. Afterward, I used the tinkercad website to draft out what I would do and manipulate the virtual board until there were no errors and mistakes, and was to my liking before redo-ing it on the physical board again.
4. Below is the short video as evidence that the code/program work.
Input devices: Interface an LDR to the maker UNO board and measure/show its signal in serial monitor Arduino IDE:
1. Below are the code/program I have used and the explanation of the code.
2. Below are the hyperlink to the sources/references that I used to write the code/program.
https://roboindia.com/tutorials/arduino-ldr-light-dependent-resistor/
3. Below are the problems I have encountered and how I fixed them.
Similar problems with the Input: Potentiometer
4. Below is the short video as the evidence that the code/program work.
Output devices: Interface 3 LEDs (Red, Yellow, Green) to maker UNO board and program it to perform something (fade or flash etc)
1. Below are the code/program I have used and the explanation of the code.
2. Below are the hyperlink to the sources/references that I used to write the code/program.
https://drive.google.com/file/d/1jRS9TqMTMg1_o6uaYrtcmnoyylz6FZCy/view?usp=share_link
3. Below are the problems I have encountered and how I fixed them.
Initially, one of the LEDs would not light up. Hence, I went to check the wires and resistors, ensuring I connected each of them correctly. It turns out that what was causing the problem was me not connecting the resistor properly. Since the components are small, it is easy to misconnect the wires or to not plug them properly. They are also very fragile so it was important to be gentle and take care of it.
4. Below is the short video as the evidence that the code/program work.
Output devices: Include pushbutton to start/stop the previous task
1. Below are the code/program I have used and the explanation of the code.
2. Below are the hyperlink to the sources/references that I used to write the code/program.
-
3. Below are the problems I have encountered and how I fixed them.
There were not much problems faced in this part of the programming as the codes were provided in the learning package. However, it too me some time to understand how different codes work and how they communicate to the arduino board itself. There were errors that popped up too such as "} was not declared" and I simply had to seek help with the internet to fix my problem.4. Below is the short video as the evidence that the code/program work.
Below is my Learning Reflection on the overall Arduino Programming activities.
Overall, this lesson on Arduino run for approximately 3 weeks++. This topic was very new to me as I have never tried programming or coding. Hence, this was a very eye-opening experience. When learning about Arduino and how to code, it seemed easy. It was simply manipulating 🚩 🚩 🚩 🚩a given code to your liking. However, what these 3 weeks taught me was that Arduino was so much more than that. In my opinion, coding was basically another form of language. The code communicates to the maker UNO board and the signal is transmitted to commands, allowing us to control the components connected to it like LEDs. As I was trying to complete the 4 challenges given, I thought just copying the code was enough. However, when changing the code to do a different command, errors were prone to occur. Hence, it took a long time to understand what was the problem and how we should go about fixing it. Some common errors were “... was not declared”, and “a function-definition is not allowed here before '{' token” that was when I had to turn to the internet to fix my problem by looking at the reviews and replies made by people suffering from the same problem. Additionally, my computer was also unable to read the correct com. When I plugged in the Arduino USB, there were a few coms that appear. By looking up this problem on the internet, his problem can be solved by simply going to the computer’s device manager -> ports (COM & LPT). This experience has also shown me how important it is to understand the codes and what they are for. For example, pinMode(10, OUTPUT) means that pin10 will receive signals and act accordingly to the code, digitalWrite(13, LOW): Pin13 will not be on unless the signal is sent when the button is pressed and delay(1000) means to is to allow a pause that lasts 1-sec. Furthermore, I also experienced using the Arduino tinkercad which allowed me to play with the Arduino board virtually before doing it in real life and this saved me a lot of time because, for any mistake I faced, I could simply delete and redo it. Compared to doing it on the physical board itself, I would have to unplug all the wires and check step by step to determine if my mistake was the wires connected, the faultiness of the wires, or my code.
This brings me to the practical we did on Arduino where we had to program the Arduino and make a pegasus flap its wing using a servo. Manipulating the delay function allows us to control how fast or slow the wings flap, allowing us to have a very majestic flapping. Altering the code by changing the degree to which the servo turns also allowed us to control how dramatic the flapping was. The practical we did made us brainstorm ways to make our pegasus the nicest out of all the pairs. During that time, my team and I had to come up with the code by using what we have learned and taken notes of in the pre-practical. Of course, there were errors in the codes and we could only simply trial and error till our code works. The next challenge we faced was making the LED light up at the same time as the servo running. It worked initially but it stopped working. We came to the conclusion that because the power given out by the computer could be too strong, it caused the bulb to fuse and the servo chip to burnt. We then made sure that when we were changing anything connected to the board, we will unplug the USB so that no power can enter. All in all, I have come to realize that programming is a very tedious task and both physically and mentally challenging. This is because the wires and other equipment like the resistors are very fragile and can easily be disconnected if it's accidentally knocked into. It is also difficult to connect it properly because it's so small. Additionally, it is mentally challenging as errors in the codes are very common. Hence, a lot of patience is needed to ensure it runs smoothly. However, it is also a very fulfilling experience when an obstacle was overcomed, and seeing a successful end product which was possible as I sought help from my peers and the internet after trying multiple times.
No comments:
Post a Comment