example: Fix examples.

This commit is contained in:
kaizhi-singtown 2025-04-22 09:59:06 +08:00
parent 47704a3856
commit c42bace0a5
6 changed files with 7 additions and 6 deletions

View File

@ -19,6 +19,7 @@ import image
import time import time
import mjpeg import mjpeg
import random import random
import machine
sensor.reset() # Reset and initialize the sensor. sensor.reset() # Reset and initialize the sensor.
sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE) sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE)

View File

@ -32,8 +32,8 @@ kpts = img.find_keypoints(max_keypoints=150, threshold=10, scale_factor=1.2)
if kpts is None: if kpts is None:
raise (Exception("Couldn't find any keypoints!")) raise (Exception("Couldn't find any keypoints!"))
image.save_descriptor(kpts, "/%s.orb" % (FILE_NAME)) image.save_descriptor(kpts, "%s.orb" % (FILE_NAME))
img.save("/%s.pgm" % (FILE_NAME)) img.save("%s.pgm" % (FILE_NAME))
img.draw_keypoints(kpts) img.draw_keypoints(kpts)
sensor.snapshot() sensor.snapshot()

View File

@ -9,4 +9,4 @@ import network
wlan = network.WINC(mode=network.WINC.MODE_FIRMWARE) wlan = network.WINC(mode=network.WINC.MODE_FIRMWARE)
# For ATWINC1500-MR210PB only. # For ATWINC1500-MR210PB only.
wlan.fw_dump("/winc_19_7_6.bin") wlan.fw_dump("winc_19_7_6.bin")

View File

@ -20,4 +20,4 @@ import network
wlan = network.WINC(mode=network.WINC.MODE_FIRMWARE) wlan = network.WINC(mode=network.WINC.MODE_FIRMWARE)
# For ATWINC1500-MR210PB only. # For ATWINC1500-MR210PB only.
wlan.fw_update("/winc_19_7_6.bin") wlan.fw_update("winc_19_7_6.bin")

View File

@ -6,6 +6,7 @@
import network import network
import requests import requests
import time
# AP info # AP info
SSID = "" # Network SSID SSID = "" # Network SSID

View File

@ -10,10 +10,9 @@ import time
from pyb import Pin, Timer from pyb import Pin, Timer
tim = Timer(4, freq=1000) # Frequency in Hz tim = Timer(4, freq=1000) # Frequency in Hz
# Generate a 1KHz square wave on TIM4 with 50%, 75% and 50% duty cycles on channels 1, 2 and 3 respectively. # Generate a 1KHz square wave on TIM4 with 50% and 75% duty cycles on channels 1 and 2 respectively.
ch1 = tim.channel(1, Timer.PWM, pin=Pin("P7"), pulse_width_percent=50) ch1 = tim.channel(1, Timer.PWM, pin=Pin("P7"), pulse_width_percent=50)
ch2 = tim.channel(2, Timer.PWM, pin=Pin("P8"), pulse_width_percent=75) ch2 = tim.channel(2, Timer.PWM, pin=Pin("P8"), pulse_width_percent=75)
ch3 = tim.channel(3, Timer.PWM, pin=Pin("P9"), pulse_width_percent=50)
while True: while True:
time.sleep_ms(1000) time.sleep_ms(1000)