CP5070-2021-2B07-Group5-Iman

Monday, 29 November 2021

Arduino programming

How do I program the Arduino board?

Step 1: Connect Arduino Maker Uno to computer via USB cable 

Step 2: Open Arduino IDE software





Step 3: Do your own coding or just copy from the internet.

Using tinkercad  

1. Potentiometer with the serial monitor 

 
2. LDR with the serial monitor 


3. 3 LEDs (fade)


4. DC motor with on/off push button.

What I learned from interfacing an input device to Arduino board? 

In the unicorn challenge, I used pin 2 as an input device. I learned that when the programmable button is pressed the output device is on. When the button is released, the output device is off.  

What I learned from interfacing an output device to arduino board? 

In the unicorn challenge, I used pin 9 as an output device for the servo. I learned that if we use pin 11 as the output device. We didn't change the pinMode(9, OUTPUT) to pinMode(11, OUTPUT) the servo will not work as the data cannot be transferred to the servo. 

Source code: 


Problems that I occur and how I fixed them? 

The problem that occurs is the servo is not smooth when turning. I need to increase the delay time from 15 milliseconds to 150 milliseconds. To make the servo turn smoothly. 

A short video of the executed program work. 


Reflection 

This unicorn challenge is very good for the students like me. It is because it makes me think about how to use the servo motor and to make the changes based on the smoothness or the speed of the wings flapping. Also, to make it more challenging my group and I put a programmable button so that when it press, the wings start to flap. Furthermore, during the competency test, I need to make a traffic light using an onboard LED with no delay. My mistake was by putting delay(0) after digitalWrite(11, LOW). There shouldn't be a delay of 0 because it adds up the program storage space.
Share This

No comments:

Post a Comment

Designed By Blogger Templates