Python Tutorials – பாடம் 2 – Double led blink using Raspberry Pi Pico

Raspberry Pi Pico வை பயன்படுத்தி இரண்டு LED ஐ ஒளிர வைப்பது

Required Components

  1. Led-2 no
  2. Raspberry Pi Pico board-1 no
  3. Connecting wires-1 set

Circuit

Steps

  1. நாம் பயன்படுத்தும் உபகரணங்கள் சரியாக வேலை செய்கிறதா என்பதை உறுதி செய்து கொள்ளவும்.
  2. 2 LED வில் உள்ள ground இணைப்புகளை Raspberry Pi Pico வில் உள்ள ground உடன் இணைக்க வேண்டும்.
  3. Raspberry Pi Pico GP2, GP20 உடன் 2 LED + யை இணைக்க வேண்டும்.
  4. Python program ஐ சரி பார்க்க வேண்டும்.
  5. மின்சுற்றை சரி பார்க்க வேண்டும்.
  6. Python program ஐ ரன் செய்ய வேண்டும்.

Python Program

from machine import Pin
import utime  #timer

led1=Pin(2,Pin.OUT)
led2=Pin(17,Pin.OUT)

while(True):    
    led1.value(1)
    led2.value(1)
    utime.sleep(2) #delay of 1 sec
    led1.value(0)
    led2.value(0)
    utime.sleep(2)

Leave a Reply

Your email address will not be published. Required fields are marked *