Raspberry Pi Pico GPIO
Raspberry Pi Pico GPIO
- GPIO反转速度
- C
- MicroPython
GPIO反转速度
C
1、示波器实测
2、测试代码
/*** Copyright (c) 2020 Raspberry Pi (Trading) Ltd.** SPDX-License-Identifier: BSD-3-Clause*/#include "pico/stdlib.h"int main() {
#ifndef PICO_DEFAULT_LED_PIN
#warning blink example requires a board with a regular LED
#elseconst uint LED_PIN = 0;//PICO_DEFAULT_LED_PIN;gpio_init(LED_PIN);gpio_set_dir(LED_PIN, GPIO_OUT);while (true) {i = 0;gpio_put(LED_PIN, 1);//sleep_ms(1);//sleep_us(2ull);gpio_put(LED_PIN, 0);//sleep_ms(1);//sleep_us(2ull);}
#endif
}
MicroPython
1、示波器实测
2、测试代码
from machine import Pin
import timeled=Pin(0,Pin.OUT)while True:led.toggle()