Laser Emitter
Overview
Built-in laser emitter head, turns on the laser with a high level, turns off with a low level.
Technical Specifications
Operating voltage: VCC 3.3V -5V
Module dimensions: 24*48mm
Mounting: 2 plastic building block compatible through-holes
Control method: Digital input
Pin Definition
Pin |
Definition |
|---|---|
GND |
Ground |
VCC |
Power |
DI |
Digital input |
NC |
Not connected |
Example Code
Press the A button to emit laser; press the B button to turn off the laser.
from mpython import *
p0 = MPythonPin(0, PinMode.OUT)
def on_button_a_pressed(_):
p0.write_digital(1)
button_a.event_pressed = on_button_a_pressed
def on_button_b_pressed(_):
p0.write_digital(0)
button_b.event_pressed = on_button_b_pressed