For fast transaction call 0916.457.0748
Easy Learning Kit for Arduino Tutorial

Easy Learning Kit for Arduino Tutorial

The Arduino UNO is the most used board in the family of Arduino boards.  If you are starting out with Arduino, this is the board to get. Here are some tutorials that you may need to know for you to gain more knowledge about arduino and programming.

 

Blinking a LED

 

 

Things you'll need:

  • 1pc Arduino UNO Rev 3 
  • 1pc Arduino UNO Power Cable 
  • 1pc UNO R3 Photoshield with breadboard 
  • 1pc LED 
  • 1pc 220 ohms Resistor 
  • 2pc male to male connecting wire

Hardware assembly

            Schematic Diagram

 

  

Actual Material

You need first to integrate the Arduino Uno and the Uno Photoshield, make sure that the Arduino Uno board is under the Photoshield with its corresponding pin slots.

 

Connect your Arduino Board to your computer using the UNO Power Cable.

 

Building the Code

For you to code the Arduino UNO, you need first to install the Arduino Software from their official Website.

Open up Arduino IDE. Coding in this software will control the output in your arduino board.

  

Next assign the serial port to the connected Arduino Board by clicking the “Tools” in menu bar and select the allocated port, which in our case it’s port COM12.

 

Also select the board you are using in “Tools” and choose Board.

 

Write the following codes:

int ledPin = 13;                        // assign pin 13 as the LED output
void setup() {
 pinMode(ledPin, OUTPUT);   // configure ledPin as an Output
 
}
 
void loop() {
 digitalWrite(ledPin, HIGH);    // makes the output value of high and light up the LED
 delay(1000);                           // delay of 1 second for you to see the alteration of the blinking LED
 digitalWrite(ledPin, LOW);     // makes the output value of low and turn off the LED light
 delay(1000);
}

 

Upload the code and you’ll notice that the LED is blinking with its transition of 1 second.

 

 

 

 Making use of a switch to turn on the LED

Things you'll need:

  • 1pc Arduino UNO Rev 3 
  • 1pc Arduino UNO Power Cable 
  • 1pc UNO R3 Photoshield with breadboard 
  • 1pc LED
  • 1pc Push Button Switch 
  • 2pc 220 ohms Resistor 
  • Connecting wire

 Schematic Diagram

Actual Material

Write the following codes in your Arduino Software:

int button = 8; //assign the serial port of button to serial 8
int ledPin = 13; //assign the serial port of LED to serial 13
 
void setup(){
Serial.begin(9600);  // for you to use the serial monitor and make sure that the button is working
pinMode(ledPin, OUTPUT); // set serial pin to output for the LED
pinMode(button, INPUT);  // set serial pin to input for the push button
 
}
 
void loop(){
 
  if (digitalRead(button) == true) {  //if the button is pressed
    digitalWrite(ledPin, HIGH);       // signals a high output to the port connected to the LED
    Serial.println("Button Pressed"); // print "Button Pressed" in the serial monitor
  } else{                             // if button is not pressed
    digitalWrite(ledPin, LOW);        //signals a low output to the LED port
  }
  delay(50);
}

 

Upload the code and try pressing the switch. You’ll notice that when you press the switch, it turns on the light of the LED.

 

Display the Serial Monitor by clicking the Upper Right Icon in your Arduino Software.

Set the Baud Rate to 9600. 

 

 

 

 

 

 

 

 

 

 

 

 

Happy Coding!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


0 comments

Leave a comment

Please note, comments must be approved before they are published

Payment Methods

Facebook Rewards Program