summaryrefslogtreecommitdiff
path: root/Other_Arduino_Codes/Laser_PWM
diff options
context:
space:
mode:
Diffstat (limited to 'Other_Arduino_Codes/Laser_PWM')
-rw-r--r--Other_Arduino_Codes/Laser_PWM/Laser_PWM.ino19
1 files changed, 19 insertions, 0 deletions
diff --git a/Other_Arduino_Codes/Laser_PWM/Laser_PWM.ino b/Other_Arduino_Codes/Laser_PWM/Laser_PWM.ino
new file mode 100644
index 0000000..08ba1dd
--- /dev/null
+++ b/Other_Arduino_Codes/Laser_PWM/Laser_PWM.ino
@@ -0,0 +1,19 @@
+int pin=6; // Pin to which you connect the gate (G) of the MOSFET.
+
+void setup() {
+ // put your setup code here, to run once:
+pinMode(pin,OUTPUT);
+Serial.begin(9600);
+}
+
+void loop() {
+ // put your main code here, to run repeatedly:
+analogWrite(pin, 250); // High Intensity
+delay(5000);
+analogWrite(pin, 100); // Medium intensity
+delay(5000);
+analogWrite(pin, 50); // Low intensity
+delay(5000);
+
+}
+