Will_the_Star
Published © GPL3+

Tutorial for Arduino Beginners PART I

Create a short array of LEDs which switch on and off from the press of a button.

BeginnerFull instructions provided1,073
Tutorial for Arduino Beginners PART I

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
Just one or the other
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Breadboard (generic)
Breadboard (generic)
×1
Pushbutton switch 12mm
SparkFun Pushbutton switch 12mm
×1
5 mm LED: Red
5 mm LED: Red
×1
5 mm LED: Green
5 mm LED: Green
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Long-nosed/Needle-nosed pliers

Story

Read more

Schematics

The Finished Project

The project is now finished!

Code

LEDs with serial monitor

Arduino
Paste the code into a new, empty Arduino IDE window. Plug in your Arduino Uno, via the USB connection cord. Then, from the top toolbar, click Tools>Boards and click Arduino Uno. Go back into tools and click ports. Click the one that you Arduino board is in. Now, you're done! Near the toolbar, you'll see the final button: Upload (->), and feel the joy as Arduino IDE uploads the code to your robot. Now, we just need to use it. Go to the RUNNING step and follow the instructions.
int outPin = 13;
void setup(){

  pinMode(outPin,OUTPUT);
  Serial.begin(9600);
  Serial.println("Enter 0 or 1");
}
void loop(){
  if(Serial.available()>0)
  {
    char ch = Serial.read();
    if (ch == '1')
  {
    digitalWrite(outPin,1);
  }
  else if (ch == '0')
  {
    digitalWrite(outPin,LOW);
 }

}
}

Credits

Will_the_Star

Will_the_Star

6 projects • 26 followers
I am eleven years old. I have a proven IQ of 154. I am not lying, joking, kidding or trying to mislead you in any other way.

Comments