A basic example of controlling a laser using an Arduino.
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);
}You will need to setup the following circuit using your Arduino:
Full tutorial URL:
https://codeadam.ca/learning/arduino-laser.html
- Visual Studio Code or Brackets (or any code editor)
- Arduino Create
