分类 RP2040 下的文章

针对Pin0~25,ADC0~3,进行最基础的测试,在本次测试中Pin14,Pin16,Pin17与CPU断连,测试代码如下:

for i in range(0,26,1):
    Pin(i, Pin.OUT).off()
    time.sleep(0.1)

for i in range(0,26,1):
    if(i<1):
        print(str(i)+" ON")
        Pin(i).on()
        time.sleep(5)
    else:
        print(str(i)+" ON")
        Pin(i).on()
        time.sleep(0.1)
        num = i-1
        Pin(num).off()
        time.sleep(6)



adc0 = ADC(0)
adc1 = ADC(1)
adc2 = ADC(2)
adc3 = ADC(3)

for i in range(0,20,1):
    print("ADC0"+str(adc0.read_u16()))
    print("ADC1"+str(adc1.read_u16()))
    print("ADC2"+str(adc2.read_u16()))
    print("ADC3"+str(adc3.read_u16()))
    time.sleep(1)
测试区域你看不见我你看不见我