More about Arduino
We will start from simple programming and setup of Arduino. This will be about simple LED blinking with a program.
Material required:
Program:
Explanation:
First of all you should know it is a case sensitive language, a single mistake of a word or a punctuation mark can spoil your program. Now as you can see written "void setup" in the image, under this you will write that from which pin you have given output so we have written 13,OUTPUT in the void loop in curly brackets. And under "void loop" we have written that in which terminal how much current should enter and it will repeat again and again. We have written digitalWrite because we have given the connection in the digital pins and you don't need to write 13 every time as 13 is the pin number in which I have given connection which means you can connect to any digital pin and write that number. delay(1000) here means 1 second, and HIGH and LOW means current will become make the LED glow and then off. We have written semicolon after every line so that the next statement can continue without it you cannot move to next step.
Material required:
- Breadboard
- LED [3 volt]
- Some jumper wires [Male to Male]
- Arduino board
Procedure:
- Take the LED and fix it on the breadboard placing its terminal horizontally on the area where alphabets are written. Positive terminal [Big leg of LED] will be left hand side and negative terminal [Small leg of LED] will be right hand side.
- Take the arduino board and fix the first jumper wire on the ground pin [GND] area of the digital pins, and other jumper wire to the pin 13 just below GND.
- Now fix the ending point of jumper wire [Which you have connected to pin 13] below the positive terminal of LED but before the partition line.
- And other ending point of jumper wire [Which you have connected to GND] below the negative terminal of LED but before the partition line.
- Your setup is ready.
- Just connect your arduino board to your PC or Laptop.
- Write the program and after writing the program check it by clicking on the tick symbol on the ribbon and then upload it after saving. Upload option is also on the ribbon it is an arrow going right side.
Explanation:
First of all you should know it is a case sensitive language, a single mistake of a word or a punctuation mark can spoil your program. Now as you can see written "void setup" in the image, under this you will write that from which pin you have given output so we have written 13,OUTPUT in the void loop in curly brackets. And under "void loop" we have written that in which terminal how much current should enter and it will repeat again and again. We have written digitalWrite because we have given the connection in the digital pins and you don't need to write 13 every time as 13 is the pin number in which I have given connection which means you can connect to any digital pin and write that number. delay(1000) here means 1 second, and HIGH and LOW means current will become make the LED glow and then off. We have written semicolon after every line so that the next statement can continue without it you cannot move to next step.
0 Comments:
Post a Comment