/arduino-laser

A basic example of controlling a laser using an Arduino.

Primary LanguageC++

Arduino and a Laser

A basic example of controlling a laser using an Arduino.

Arduino Code

Open up Arduino Create and add the following code:

int laserPin = 2;

void setup() {

	pinMode(laserPin, OUTPUT);

}

void loop() {

	digitalWrite(laserPin, HIGH);
	delay(1000);

	digitalWrite(laserPin, LOW);
	delay(1000);

}

View the Arduino code on Arduino Create

You will need to setup the following circuit using your Arduino:

Tinkercad Circuit

View the Circuit on Tinkercad

Full tutorial URL:
https://codeadam.ca/learning/arduino-laser.html


Repo Resources