Day 6 - Section 2 - Handling a laser beam
Site: | ΕΛ/ΛΑΚ Moodle |
Course: | Robotics - 3D Printing - Internet of Things |
Book: | Day 6 - Section 2 - Handling a laser beam |
Printed by: | Guest user |
Date: | Wednesday, 15 January 2025, 12:22 PM |
Description
After the completion of this section the students will be able to:
- handle a laser beam
- create a circuit turn a laser beam ON and OFF
- code the NodeMCU to flash the laser beam
Let's focus on the laser beam.....
We must be very careful when we handle laser pointers and laser beams. Remember, never to point the beam to your eyes or the eyes of any person as it may harm you or them.
Now let's return to our playing environment. First, we have to build the circuit below:
In this picture we notice that the Signal (red cable) is connected to D0 pin. Considering that D0 matches to number 16 in Arduino IDE our program will be as below:
void setup() {
pinMode(16, OUTPUT);
}
void loop() {
digitalWrite(16, HIGH);
delay(500);
digitalWrite(16, LOW);
delay(500);
}
Copy the above code to the Arduino IDE and then upload it to the NodeMCU.
As you can see, the beam is blinking with a delay of half a second. Try to change the tempo and have more fun.