# mPy - FKS0001 PWM excercises, low frequency led flashing
# Copyright by Anthony Vogelaar, Perth Scotland
# rev 0.10  2025-12-23  initial release

# GPIO 34 & 35 input only

from 	machine	import	Pin, PWM, freq;		freq(240_000_000)
import	time

# ======================== main =============================

# Frequency range PWM: 1Hz .. 40 MHz 
def main():
#    led = PWM(Pin(27), freq=1, duty_u16=0x4000)			# 25%
#    led = PWM(Pin(27), freq=1, duty=512)    				# 0..1023  = %
    led = PWM(Pin(27), freq=1); led.duty_ns(500_000_000)    # duration =  sec
    time.sleep(10)
    led.deinit()


main()

# ======================== end =============================
