|
本帖最后由 scoopydoo 于 2025-3-6 21:39 编辑
这玩意儿发布很久了一直没买,因为单价太低,俺这边买啥都要运费,因此一直等到前两天在e络盟上面买元器件,才顺便整了两片回来。
拿到手第一件事当然是弄个小程序验验货,代码是 AI 写的俺一个字也没改,这种简单且常见的东西用 AI 确实是方便,基本不会出错的。
- import machine
- import time
- # Set the CPU clock frequency to 200 MHz
- machine.freq(200_000_000) # 200 MHz in Hz
- # Get the updated frequency of the clock (CPU)
- frequency = machine.freq()
- # Format the frequency with commas for readability
- formatted_frequency = "{:,}".format(frequency)
- # Print the updated clock frequency with commas
- print("Updated clock frequency:", formatted_frequency, "Hz")
- # Configure the onboard LED using GPIO 25
- led = machine.Pin(25, machine.Pin.OUT)
- # Blink the LED at a frequency of 3 Hz (3 times per second)
- while True:
- led.on() # Turn the LED on
- time.sleep(1 / (3 * 2)) # Half-period for 3 Hz
- led.off() # Turn the LED off
- time.sleep(1 / (3 * 2)) # Half-period for 3 Hz
复制代码
|
评分
-
2
查看全部评分
-
|