Raspberry Pi Pico வை பயன்படுத்தி LDR ஐ கட்டுப்படுத்துவது
Required Components
- LDR Sensor-1 no
- Raspberry Pi Pico board-1 no
- Connecting wires-1 set
Circuit
Steps
- நாம் பயன்படுத்தும் உபகரணங்கள் சரியாக வேலை செய்கிறதா என்பதை உறுதி செய்து கொள்ளவும்.
- Raspberry Pi Pico பின்னான GP27 ஐ LDR பின்னான D0 உடன் இணைக்க வேண்டும்.
- Raspberry Pi Pico பின்னான 3V3 (OUT) ஐ LDR பின்னான +5V உடன் இணைக்க வேண்டும்.
- Raspberry Pi Pico GND உடன் LDR GND ஐ இணைக்க வேண்டும்.
- Python program ஐ சரி பார்க்க வேண்டும்.
- மின்சுற்றை சரி பார்க்க வேண்டும்.
- Python program ஐ ரன் செய்ய வேண்டும்.
Python Program
from machine import Pin
import time
ldr = machine.ADC(27)
while True:
print(ldr.read_u16())
time.sleep(2)