newproyecto
Published © GPL3+

Laser project

Learn how to make a simple laser

BeginnerFull instructions provided559
Laser project

Things used in this project

Story

Read more

Schematics

scheme

Code

code

Arduino
int offbtn = 11;
//the off button//
int onbtn = 12;
//the on button//
int laser = 13;
//the laser pin//
void setup() {
 // inputs
 pinMode(offbtn, INPUT);
 pinMode(onbtn, INPUT);
// and outputs
 pinMode(laser, OUTPUT);
}

void loop() {
  // The first part is for you to turn on and the second for you to turn off.
  if (digitalRead(onbtn)==HIGH){
    digitalWrite(laser, HIGH);
    }
    if (digitalRead(offbtn)==HIGH){
       digitalWrite(laser, LOW);
     }

}

Credits

newproyecto

newproyecto

3 projects • 4 followers
Hello everyone, my name is Antonio and I love programming and doing projects with Arduino and I hope these projects will help you.

Comments