Arduino Programming

Arduino Programming

Figure 1: Tasks

Input devices
  • Interface a Potentiometer Analog Input to maker UNO board and measure its signal in serial monitor Arduino IDE
Figure 2: guide video of 1st task



The Arduino Analog Digital Converter (ADC) will convert the signal of 0-5V to 0-1023ms. analogRead(A0) reads the value at Pin A0 and gives it a sensorValue. Based on the value, a delay of 0-1023ms and that determines how fast the LED flashes.

Figure 3: video of 1st task



  • Interface an LDR to maker UNO board and measure its signal in serial monitor Arduino ID
Figure 4: guide video of 2nd task

The code works similar to the potentiometer where it reads the signal from pin A0. As more light is shone on the resistor, the resistance decreases, which allows the LED to light up brighter. 

Figure 5: video of 2nd task



Output devices

  • Interface 3 LEDs (Red, Yellow, Green) to maker UNO board and program it to perform something (fade or flash etc)

Figure 6: guide video of 3rd task

I duplicated the circuit and added 2 more LEDs beside the first. For the code, under void setup, I added 2 more pinModes. While for the void loop section, I just duplicated the code for the first fade and changed the respective pin.


Figure 7: video of 3rd task



  • Interface the DC motor to maker UNO board and program it to on and off using push button on the board 

Figure 8: guide video of 4th task


This task did not have those easier tutorials readily made on TinkerCad, but it did not take long for me to find the Tinkercad Design that was designed by another person

Figure 9: video of 4th task

Link for DC motor

Problems faced

I tried using text for the coding for some parts instead of block coding and I found it way more difficult than I thought as I kept missing out on things such as brackets which made the code unusable. 


Reflection

This practical enabled me to really see the power of  Arduino Programing. Although this process can be quite frustrating, I feel that this is a very useful skill that I would use in the future. 

Through this Arduino Programming activity, I was also able to learn more about the UNO board and how it is capable of doing simple programs such as the LED fade or the DC motor on/off which are activities that I have covered on top. I would not say that it is easy to learn but the online tutorial videos that are made by other people certainly did help to make the learning process much easier and enjoyable.

Overall. I think I will continue to learn about programming in general as I found the experience fun and that there is future prospects in programming.