from machine import RTC,Pin
from time import sleep_ms
UP = "\x1B[3A"
CLR = "\x1B[0K"
rtc = RTC()
led_flash = Pin(5,Pin.OUT)
# Datetime is a tuple of the form:
# (year, month, day, weekday, hours, minutes, seconds, subseconds)
# weekday and subseconds can be left 0
# Example: 26th of September 2022, 10:00
rtc.datetime((2022, 9, 26, 0, 12, 00, 00, 0)) # set a specific date and time
while True:
date_time = rtc.datetime()
print(UP,"The input voltage is 5 volts",
CLR ,"\n","The frequency is 5 Hz with a duty cycle of",
CLR ,"\n")
led_flash.value(not led_flash.value())
sleep_ms(1000)