Arduino programming
Arduino Programming is a beginner’s introduction to the world of coding technology. π²π§πΎ
With Arduino, I am able to automate a system with its program function.
For example, I can move a servo motor unit, play music or even light up an LED. Furthermore, these are all just BASIC examples of what coding can achieve.
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.
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.
Below are the problems I have encountered and how I fixed them.
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 is the hyperlink to the sources/references that I used to write the code/program.
Below are the problems I have encountered and how I fixed them.
My photoresistor initially brightened in the presence of light which was rather redundant
I had 2 options, to reprogram my code, or to rewire the wires along the breadboard
Of course, I chose the latter which was much easier
Hence, I rewired my connections and included a 10000-ohm resistor for the photoresistor
Below is the short video as the evidence that the code/program work.
The video depicts the serial monitor rapidly varied signal values due to the changes in brightness sensed by the photoresistor. Really interesting display to watch!
LEDS work from 0-255 where 255 is the maximum possible value for rgb
This concept relates back to the first practical on laser cutting, where we had to edit the rgb values.
As shown in the videos, the LED varies its brightness based on the level of light detected from its immediate surroundings.
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.
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 are the hyperlink to the sources/references that I used to write the code/program.
- https://www.youtube.com/watch?v=PC15jBx2UxI
- https://docs.google.com/document/d/1dkPpvAZLG08-kHXN8Wqfcl0jDwZGkVYI/edit?usp=sharing&ouid=114713459943392916773&rtpof=true&sd=true
Below are the problems I have encountered and how I fixed them.
I was really stuck on this one and did not know where to start. I attempted Youtube and the reliable Autodesk channel was of little help.
I then recalled that I did up a Programmable button LED challenge for one of the introductory pre-practical activities.
I hastily opened up the document where my code was and I pasted it into a new sketch on my IDE application.
I then added 2 other output signal holders into my code into the setup and then along with the loop. I checked the code and uploaded it to my board.
At first, I made the connection of the output signals and only saw that the board's pins were lighting up; my Breadboard LEDs were off.
I then connected the rest of the wires to their relevant connections and hoped for the best...
Eureka! It finally worked. I was amazed at my quick thinking and recalling of information when I needed it.
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, the Arduino Programming activities were really tough and frustrating for me and gave me a hard time. I had many problems and troubleshooting obstacles. π
However, I persevered and managed to complete all of them proudly with the assistance of, and honourable mentions to Youtube and Google π π₯.
Also, the medium that made my blog activities possible was Autodesk Tinkercad. I could create code strings easily with their block builder function and the translated code would be there for me to download and open with my Arduino IDE application. This was really useful for me as a novice to coding. For the physical connections, I could simply copy what was done already in Tinkercad and test/troubleshoot my softcopy design before physically making wire connections. I felt like a surgeon or seamstress, delicately placing the wires into the breadboard.
For the breadboard connections, before I had watched any videos, I had completely no understanding of how it worked and I thought that I had to push the wires through the holes and go into the holes and come out of them to the opposite. However, now I know that the breadboard has metallic connections vertically and are not connected horizontally. This makes my breadboard wiring much more efficient.
If I were to redo breadboard connections or explain it to a newbie, I definitely could. I hope that I am able to apply this newfound skill into my final prototype project for this module, the tea maker machine.
Arduino and Breadboard wiring for Potentiometer
At a glance, any Tom, Dick or Harry would not be able to understand what in the world this is. However, after I went through the learning exercises and packages, I am able to easily explain this picture and circuit.
From this, I realised that anyone is able to do programming. However, it is a skill that requires painful amounts of time and dedication. If someone is uninterested in it, they will never be able to master this skill. Likewise, this applies to everything for life.
And as always, in order to learn a new skill, we want to start up slowly by attempting easy codes. We then slowly ramp up our engine to create tougher codes.
After completing this suite of activities, I think that high-level coding is not my thing. But, I could definitely look at creating new functional codes via the Autodesk Tinkercad website. I was really excited every time I created a new workable code, and thought to myself, "I'm a genius!" Furthermore, the Arduino Maker UNO kit comes with many kinds of device add-ons for me to play with.
Practical:
With respect to the core practical, my team distributed ourselves into pairs. This activity was interesting, where we were exposed to a live scenario of turning our codes into reality.
Hero Shot of my team and me with our final products |
Hong Yi and I made the majestic Protector Pegasus, the Crimson Midnight Pegasus; Betty
The majestic Betty being photographed up-close ππ΄π |
Through and through with this Arduino coding suite, one thing remained constant, it was that all these activities taught us the skill of turning our Arduino codes into a useful application for real-world use. Although still a beginner, I can safely say that I am able to program my Arduino Maker circuit to perform the function that I want.
To end, I also managed to complete one of the personal goals π that I had set for myself at the start of this module. I am now able to understand how coding is done, as that was something that I had always been curious about. Now, I am able to code my board circuit to do simple practical activities, such as turn on an LED when there is no light! π‘