print("Hello,Pi Pico!")
print("This is Experiment - 2 and Objective - 4")
print("Objective : 4 Implementation of an electronic circuit in which an external LED flashes the SOS signal in Morse code (three dots, followed by three dashes, followed by three dots) continuously using Raspberry Pi Pico. A dot is represented with the LED being ON for 0.25 seconds (Dot time) and a dash is represented with the LED being ON for 1 second(Dash time). The delay between the dots and dashes is set to 0.5 second (GAP time). This process is repeated continuously after 2 seconds of delay.")
from machine import Pin
from utime import sleep
led = Pin(0, Pin.OUT)
dot=0.25
dash=1
gap=0.5
on=1
off=0
while True:
for i in range(0,3):
led.value(on)
sleep(dot)
led.value(off)
sleep(dot)
sleep(gap)
for i in range(0,3):
led.value(on)
sleep(dash)
led.value(off)
sleep(dash)
sleep(gap)
for i in range(0,3):
led.value(on)
sleep(dot)
led.value(off)
sleep(dot)
sleep(gap)