#Program: Pico_Python_21Register.py #########
from micropython import const
from machine import Pin, mem32
import time
#Access Direct Registers here
GPIO_IN = const(0xD0000004)
GPIO_OUT = const(0xD0000010)
GPIO_OUT_SET = const(0xD0000014)
GPIO_OUT_CLR = const(0xD0000018)
GPIO_OUT_XOR = const(0xD000001C)
pin_LED1 = 12
pin_LED2 = 13
BIT12 = 0b0001000000000000
BIT13 = 0b0010000000000000
#setup here
LED1 = Pin(pin_LED1, Pin.OUT)
LED1.off()
LED2 = Pin(pin_LED2, Pin.OUT)
LED2.off()
print("Hello World,","LED1&2 : off")
#infinite loop here
while True:
mem32[GPIO_OUT_SET] = BIT12
time.sleep_ms(1000)
mem32[GPIO_OUT_CLR] = BIT12
mem32[GPIO_OUT_SET] = BIT13
time.sleep_ms(1000)
mem32[GPIO_OUT_CLR] = BIT13
#END program here ##################