Arduino
Arduino Documentation Blog Entry
There are 4 tasks that will be explained in this page:
Input devices:
Interface a potentiometer analog input to maker UNO board and measure/show its signal in serial monitor Arduino IDE.
Interface a LDR to maker UNO board and measure/show its signal in serial monitor Arduino IDE
Output devices:
Interface 3 LEDs (Red, Yellow, Green) to maker UNO board and program it to perform something (fade or flash etc)
Include the pushbutton on the MakerUno board to start/stop part 2.a. above
For each of the tasks, I will describe:
The program/code that I have used and explanation of the code. The code is in writable format (not an image).
The sources/references that I used to write the code/program.
The problems I encountered and how I fixed them.
The evidence that the code/program worked in the form of video of the executed program/code.
Finally, I will describe:
My Learning reflection on the overall Arduino programming activities.
Practical
In this practical, every group was supposed to split into 2 smaller groups within their own. For my own group, we had 5 members and I was split into the small group which consisted of Frizanah, Kerri and I . Then each group was supposed to build a cardboard unicorn by following the instructions given on a paper.
After building the unicorn, we are then suppose to make the unicorn:
1. Perform its main function (flapping)
2. Compact & can easily be moved (no loose pieces)
3. Reliable and durable (doesn’t fail and no parts failing)
4. Aesthetically pleasing
5. Can perform other function
Our group then started discussing how we should make the wings flap first. We had no idea how to start and we started to look around to get some from other group. We saw Dylan and Darel group, who are our CPDD groupmate, using a servo motor and a thin metal wire to make their wings flap. So we decided to follow them. I started by looking for code in brightspace to make the servo motor move, however the servo motor did not move when I uploaded it onto the uno maker kit even though I placed the wire in the right place. Then, my lecturer suggested that it could be the servo which might not be working. So I borrowed Dylan group servo and connected it to my uno maker kit. To my surprise, the servo started to move and I was very glad that it worked and I asked the lecturer for a replacement for the servo motor. The lecturer then gave me another servo and this time the servo started to turn 720o even though I made the code to turn it 180o. I informed the lecturer about the abnormality and the lecturer realised that he gave us a continuous servo motor which was the wrong motor. He apologised to us and gave us another new servo. This time, the servo was working perfectly. Then, we connect one end of the wire to the servo motor and the other end to the wing of the unicorn. After we uploaded the code onto the arduino uno maker, the servo started to turn and pulled the metal wire back and forth, which made the wings flap. This made me very happy as it took us so much time to just make the wings flapped. Afterward, we still have to make the product aesthetically pleasing. So my group wanted to make the wings of the LED lid up, however none of us know how to do it so we decided to just put LEDs on the wings for aesthetics. Other than that, my group wanted to have music playing while the wing is flapping. While I am trying to find music code online, my groupmate continues to try to make the product look more aesthetic. I was so stressed because all the music code I found online was working. This was because the code they made needed external buzzers so that it could play the music out. However, after looking through the code, I managed to modify it so that it could play music from the built-in buzzer from the uno maker kit. Other than that, my groupmate made the unicorn looked like starlight from ‘my little pony’. But then came another problem, I was able to make the music play, I was able to make the wing flap, the problem now was that I had to combine the code together so that it would make the wing flap and play music at the same time. In the end, I was able to combine both code together and here is what the final end product looked like.
We used the song from super mario bros. Something I felt that could be done better was I could have made the wing not flapped to the music rhythm because the wing flapping felt very weird to me. But because of the time constraint, I was unable to make it happen.
Input devices: Interface a potentiometer analog input to maker UNO board and measure/show its signal in serial monitor Arduino IDE.
Below are the code/program I have used and the explanation of the code.
Below are the hyperlink to the sources/references that I used to write the code/program.
https://www.youtube.com/watch?v=-EDYMQ9lczA
Below are the problems I have encountered and how I fixed them.
The problematic part of this is I did not know where to connect the wire to. In the end, I managed to make it work
Below is the short video as the evidence that the code/program work.
Input devices: Interface a LDR to maker UNO board and measure/show its signal in serial monitor Arduino IDE:
Below are the code/program I have used and the explanation of the code.
Below are the hyperlink to the sources/references that I used to write the code/program.
https://www.youtube.com/watch?v=qKku-mmwNIA&t=322s
Below are the problems I have encountered and how I fixed them.
I had a hard time trying to upload the code onto the uno maker kit as there were alot of error
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)
Below are the code/program I have used and the explanation of the code.
Below are the hyperlink to the sources/references that I used to write the code/program.
https://www.youtube.com/watch?v=MojSo7OtF9w
Below are the problems I have encountered and how I fixed them.
It was very hard to connect the wire and LED onto the uno maker kit and breadboard
Below is the short video as the evidence that the code/program work.
Output devices: Include pushbutton to start/stop the previous task
Below are the code/program I have used and the explanation of the code.
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, I feel that this is a worse experience that I have every had and I would not want to do it every again
Comments
Post a Comment