Bladeren bron

【删除】使用示例转移到其他仓库

SummerGift 6 jaren geleden
bovenliggende
commit
a4034f7cc6

+ 0 - 25
examples/basic/_thread_example.py

@@ -1,25 +0,0 @@
-# 
-# Copyright (c) 2006-2019, RT-Thread Development Team
-# 
-# SPDX-License-Identifier: MIT License
-# 
-# Change Logs:
-# Date           Author       Notes
-# 2019-06-13     SummerGift   first version
-#
-
-import _thread
-import utime as time
-import gc
-
-def testThread():
-    count = 0
-    while (count < 9):
-        print("Hello rt-thread!")
-        count += 1
-
-    print("Thread exit!")
-    gc.collect()    # Free the memory space requested by the thread
-
-# TestThread thread is created with an empty argument
-_thread.start_new_thread(testThread, ())  

+ 0 - 26
examples/basic/array_example.py

@@ -1,26 +0,0 @@
-# 
-# Copyright (c) 2006-2019, RT-Thread Development Team
-# 
-# SPDX-License-Identifier: MIT License
-# 
-# Change Logs:
-# Date           Author       Notes
-# 2019-06-13     SummerGift   first version
-#
-
-import array
-
-a = array.array('i', [2, 4, 1, 5])
-b = array.array('f')
-print(a)
-print(b)
-
-a = array.array('f', [3, 6])
-print(a)
-a.append(7.0)
-print(a)
-
-a = array.array('i', [1, 2, 3])
-b = array.array('i', [4, 5])
-a.extend(b)
-print(a)

+ 0 - 26
examples/basic/math_example.py

@@ -1,26 +0,0 @@
-import math
-
-print(math.e)
-print(math.pi)
-print(math.sqrt(9))
-print(math.pow(2, 3))
-print(math.exp(2))
-print(math.log(10))
-print(math.log2(8))
-print(math.log10(10))
-print(math.radians(60))
-print(math.radians(60))
-print(math.sin(math.radians(90)))
-print(math.cos(math.radians(60)))
-print(math.tan(math.radians(60)))
-print(math.asin(0.5))
-print(math.ceil(5.6454))
-print(math.floor(2.99))
-print(math.floor(-2.34))
-print(math.fabs(-5))
-print(math.fabs(5.0))
-print(math.fmod(4, 5))
-print(math.trunc(5.12))
-print(math.trunc(-6.8))
-print(math.gamma(5.21))
-print(math.lgamma(5.21))

+ 0 - 17
examples/basic/random_example.py

@@ -1,17 +0,0 @@
-# 
-# Copyright (c) 2006-2019, RT-Thread Development Team
-# 
-# SPDX-License-Identifier: MIT License
-# 
-# Change Logs:
-# Date           Author       Notes
-# 2019-06-13     SummerGift   first version
-#
-
-import random
-
-for j in range(0, 2):
-    random.seed(13)                   # Specify random number seed
-    for i in range(0, 10):            # Generate random sequences in the range of 0 to 10
-        print(random.randint(1, 10))
-    print("end")

+ 0 - 16
examples/basic/rtthread_example.py

@@ -1,16 +0,0 @@
-# 
-# Copyright (c) 2006-2019, RT-Thread Development Team
-# 
-# SPDX-License-Identifier: MIT License
-# 
-# Change Logs:
-# Date           Author       Notes
-# 2019-06-13     SummerGift   first version
-#
-
-import rtthread
-
-# determine if code is running in a preemptible thread
-print(rtthread.is_preempt_thread())
-print(rtthread.current_tid())            # current thread id
-rtthread.stacks_analyze()                 # show thread information

+ 0 - 18
examples/basic/sys_example.py

@@ -1,18 +0,0 @@
-# 
-# Copyright (c) 2006-2019, RT-Thread Development Team
-# 
-# SPDX-License-Identifier: MIT License
-# 
-# Change Logs:
-# Date           Author       Notes
-# 2019-06-13     SummerGift   first version
-#
-
-import sys
-
-print(sys.version)
-print(sys.version_info)
-print(sys.path)
-print(sys.__name__)
-print(sys.platform)
-print(sys.byteorder)

+ 0 - 30
examples/basic/ucollections_example.py

@@ -1,30 +0,0 @@
-# 
-# Copyright (c) 2006-2019, RT-Thread Development Team
-# 
-# SPDX-License-Identifier: MIT License
-# 
-# Change Logs:
-# Date           Author       Notes
-# 2019-06-13     SummerGift   first version
-#
-
-from ucollections import OrderedDict
-from ucollections import namedtuple
-
-print("namedtuple example:")
-MyTuple = namedtuple("MyTuple", ("id", "name"))
-t1 = MyTuple(1, "foo")
-t2 = MyTuple(2, "bar")
-print(t1.name)
-print(t2.name)
-assert t2.name == t2[1]
-
-print("\nOrderedDict example:")
-# To make benefit of ordered keys, OrderedDict should be initialized
-# from sequence of (key, value) pairs.
-d = OrderedDict([("z", 1), ("a", 2)])
-# More items can be added as usual
-d["w"] = 5
-d["b"] = 3
-for k, v in d.items():
-    print("%s %s"%(k, v))

+ 0 - 41
examples/basic/uos_example.py

@@ -1,41 +0,0 @@
-# 
-# Copyright (c) 2006-2019, RT-Thread Development Team
-# 
-# SPDX-License-Identifier: MIT License
-# 
-# Change Logs:
-# Date           Author       Notes
-# 2019-06-13     SummerGift   first version
-#
-
-import uos
-
-print("Get the current directory:")
-print(uos.getcwd())
-
-print("Create folder: rtthread")
-uos.mkdir("rtthread")
-
-print("List the files in the current directory:")
-print(uos.listdir())
-
-print("Move the current directory to the rtthread folder:")
-uos.chdir("rtthread")
-
-print("Get the current directory:")
-print(uos.getcwd())
-
-print("Switch to the previous directory:")
-uos.chdir("..")
-
-print("Get the current directory:")
-print(uos.getcwd())
-
-print("List the files in the current directory:")
-print(uos.listdir())
-
-print("Delete the rtthread folder:")
-uos.rmdir("rtthread")
-
-print("List the files in the current directory:")
-print(uos.listdir())

+ 0 - 22
examples/basic/utime_example.py

@@ -1,22 +0,0 @@
-# 
-# Copyright (c) 2006-2019, RT-Thread Development Team
-# 
-# SPDX-License-Identifier: MIT License
-# 
-# Change Logs:
-# Date           Author       Notes
-# 2019-06-13     SummerGift   first version
-#
-
-import utime
-
-utime.sleep(1)                                     # sleep for 1 second
-utime.sleep_ms(500)                                # sleep for 500 milliseconds
-utime.sleep_us(10)                                 # sleep for 10 microseconds
-
-start = utime.ticks_ms()                           # get value of millisecond counter
-delta = utime.ticks_diff(utime.ticks_ms(), start)  # compute time difference
-print(utime.ticks_add(utime.ticks_ms(), -100))
-print(utime.ticks_add(0, -1))
-
-

+ 0 - 6
examples/main.py

@@ -1,6 +0,0 @@
-
-def main():
-    print("Welcome to RT-Thread MicroPython!")
-
-if __name__ == '__main__':
-    main()

+ 0 - 16
examples/network/network_wlan_ap.py

@@ -1,16 +0,0 @@
-# 
-# Copyright (c) 2006-2019, RT-Thread Development Team
-# 
-# SPDX-License-Identifier: MIT License
-# 
-# Change Logs:
-# Date           Author       Notes
-# 2019-06-13     SummerGift   first version
-#
-
-import network
-
-ap = network.WLAN(network.AP_IF)
-ap.config(essid="hello_rt-thread", password="88888888")
-ap.active(True)
-ap.config("essid")

+ 0 - 16
examples/network/network_wlan_sta.py

@@ -1,16 +0,0 @@
-# 
-# Copyright (c) 2006-2019, RT-Thread Development Team
-# 
-# SPDX-License-Identifier: MIT License
-# 
-# Change Logs:
-# Date           Author       Notes
-# 2019-06-13     SummerGift   first version
-#
-
-import network
-
-wlan = network.WLAN(network.STA_IF)
-wlan.scan()
-wlan.connect("rtthread", "02188888888")
-wlan.isconnected()

+ 0 - 16
examples/network/tcp_client.py

@@ -1,16 +0,0 @@
-# 
-# Copyright (c) 2006-2019, RT-Thread Development Team
-# 
-# SPDX-License-Identifier: MIT License
-# 
-# Change Logs:
-# Date           Author       Notes
-# 2019-06-13     SummerGift   first version
-#
-
-import usocket
-
-client = usocket.socket(usocket.AF_INET, usocket.SOCK_STREAM)
-client.connect(("192.168.10.110", 6000))
-client.send("rt-thread micropython!")
-client.close()

+ 0 - 24
examples/network/tcp_server.py

@@ -1,24 +0,0 @@
-# 
-# Copyright (c) 2006-2019, RT-Thread Development Team
-# 
-# SPDX-License-Identifier: MIT License
-# 
-# Change Logs:
-# Date           Author       Notes
-# 2019-06-13     SummerGift   first version
-#
-
-import usocket
-
-# Create STREAM TCP socket
-server = usocket.socket(usocket.AF_INET, usocket.SOCK_STREAM)
-server.bind(('192.168.12.203', 6001))
-server.listen(5)
-server.setblocking(True)
-
-while True:
-    # Wait for client connection
-    clientsocket, addr = server.accept()
-    print("connect address: %s" % str(addr))
-    clientsocket.send('welcome to rt-thread micropython!')
-    clientsocket.close()

+ 0 - 16
examples/stm32l4_pandora/adc.py

@@ -1,16 +0,0 @@
-# 
-# Copyright (c) 2006-2019, RT-Thread Development Team
-# 
-# SPDX-License-Identifier: MIT License
-# 
-# Change Logs:
-# Date           Author       Notes
-# 2019-06-13     SummerGift   first version
-#
-
-from machine import ADC     # Import the ADC class from machine
-
-adc = ADC(1, 13)            # Creates an ADC object that currently uses the 13 channels of an ADC device numbered 1
-print(adc.read())           # Gets the ADC object sampling value, value range 0 to 4096
-adc.deinit()                # Close ADC object
-adc.init(13)                # Open and reconfigure the ADC object

+ 0 - 26
examples/stm32l4_pandora/beeper.py

@@ -1,26 +0,0 @@
-# 
-# Copyright (c) 2006-2019, RT-Thread Development Team
-# 
-# SPDX-License-Identifier: MIT License
-# 
-# Change Logs:
-# Date           Author       Notes
-# 2019-06-13     SummerGift   first version
-#
-
-import utime as time
-from machine import Pin
-
-PIN_BEEPER = 18    # PB2, get the pin number from get_pin_number.py
-
-# create beeper object from pin PIN_BEEPER, Set pin PIN_BEEPER to output mode
-beeper = Pin(("beep", PIN_BEEPER), Pin.OUT_PP)
-
-beeper.value(1)            # trun the buzzer on
-time.sleep(0.5)
-beeper.value(0)            # trun the buzzer off
-time.sleep(0.5)
-beeper.value(1)
-time.sleep(0.5)
-beeper.value(0)
-time.sleep(0.5)

+ 0 - 23
examples/stm32l4_pandora/blink.py

@@ -1,23 +0,0 @@
-# 
-# Copyright (c) 2006-2019, RT-Thread Development Team
-# 
-# SPDX-License-Identifier: MIT License
-# 
-# Change Logs:
-# Date           Author       Notes
-# 2019-06-13     SummerGift   first version
-#
-
-import utime as time
-from machine import Pin
-
-PIN_LED_R = 71    # PE7, get the pin number from get_pin_number.py
-
-# create led object from pin PIN_LED_R, Set pin PIN_LED_R to output mode
-led = Pin(("led_red", PIN_LED_R), Pin.OUT_PP)
-
-while True:
-    led.value(0)  # Set led turn on
-    time.sleep(0.5)
-    led.value(1)  # Set led turn off
-    time.sleep(0.5)

+ 0 - 40
examples/stm32l4_pandora/get_pin_num.py

@@ -1,40 +0,0 @@
-# 
-# Copyright (c) 2006-2019, RT-Thread Development Team
-# 
-# SPDX-License-Identifier: MIT License
-# 
-# Change Logs:
-# Date           Author       Notes
-# 2019-06-28     SummerGift   first version
-#
-
-def get_pin_num(pin_index):
-    """
-    Get the GPIO pin number through the GPIO index, format must be "P + <A~K> + number", such as PE7
-    """
-
-    if pin_index[0] != 'P':
-        print("ERROR : Please pass in the correct parameters P + <A~K> + number, such as PE7")
-        return
-
-    if not pin_index[1].isupper():
-        print("ERROR : Please pass in the correct parameters P + <A~K> + number, such as PE7")
-        return
-
-    return (ord(pin_index[1]) - ord('A')) * 16 + int(pin_index[2:])
-
-print("The pin number of PE7 is %d, then blink the red led."%get_pin_num("PE7")) # Get the pin number for PE7
-
-# then you can use the pin num to control the device, such as led:
-
-import utime as time
-from machine import Pin
-
-# create led object from get_pin_num("PE7") and set pin to output mode
-led = Pin(("led_red", get_pin_num("PE7")), Pin.OUT_PP)
-
-while True:
-    led.value(0)  # Set led turn on
-    time.sleep(0.5)
-    led.value(1)  # Set led turn off
-    time.sleep(0.5)

+ 0 - 24
examples/stm32l4_pandora/i2c.py

@@ -1,24 +0,0 @@
-# 
-# Copyright (c) 2006-2019, RT-Thread Development Team
-# 
-# SPDX-License-Identifier: MIT License
-# 
-# Change Logs:
-# Date           Author       Notes
-# 2019-06-13     SummerGift   first version
-#
-
-from machine import Pin, I2C
-
-PIN_CLK = 29   # PB13, get the pin number from get_pin_number.py
-PIN_SDA = 30   # PB14
-
-clk = Pin(("clk", PIN_CLK), Pin.OUT_OD)   # Select the PIN_CLK pin device as the clock
-sda = Pin(("sda", PIN_SDA), Pin.OUT_OD)   # Select the PIN_SDA pin device as the data line
-i2c = I2C(-1, clk, sda, freq=100000)      # create I2C peripheral at frequency of 100kHz
-i2c.scan()                                # scan for slaves, returning a list of 7-bit addresses
-i2c.writeto(0x51, b'123')                 # write 3 bytes to slave with 7-bit address 42
-i2c.readfrom(0x51, 4)                     # read 4 bytes from slave with 7-bit address 42
-i2c.readfrom_mem(0x51, 0x02, 1)           # read 1 bytes from memory of slave 0x51(7-bit)
-i2c.writeto_mem(0x51, 2, b'\x10')         # write 1 byte to memory of slave 42
-

+ 0 - 25
examples/stm32l4_pandora/key.py

@@ -1,25 +0,0 @@
-# 
-# Copyright (c) 2006-2019, RT-Thread Development Team
-# 
-# SPDX-License-Identifier: MIT License
-# 
-# Change Logs:
-# Date           Author       Notes
-# 2019-06-13     SummerGift   first version
-#
-
-from machine import Pin
-
-PIN_LED_R   = 71    # PE7, get the pin number from get_pin_number.py
-PIN_KEY0    = 58    # PD10
-KEY_PRESSED = 0
-
-# create led object from pin PIN_LED_R, Set pin PIN_LED_R to output mode
-led = Pin(("led_red", PIN_LED_R), Pin.OUT_PP)
-key_0 = Pin(("key_0", PIN_KEY0), Pin.IN, Pin.PULL_UP)
-
-while True:
-    if key_0.value() == KEY_PRESSED:
-        led.value(0)  # Set led turn on
-    else:
-        led.value(1)

+ 0 - 28
examples/stm32l4_pandora/lcd.py

@@ -1,28 +0,0 @@
-# 
-# Copyright (c) 2006-2019, RT-Thread Development Team
-# 
-# SPDX-License-Identifier: MIT License
-# 
-# Change Logs:
-# Date           Author       Notes
-# 2019-06-13     SummerGift   first version
-#
-
-from machine import LCD     # Import the LCD class from machine
-
-lcd = LCD()                             # Create a LCD object
-lcd.light(False)                        # Close the backlight
-lcd.light(True)                         # Open the backlight
-lcd.set_color(lcd.WHITE, lcd.BLACK)     # Set background color and foreground color
-lcd.fill(lcd.BLACK)                     # Fill the entire LCD with black
-lcd.fill(lcd.RED)                       # Fill the entire LCD with red
-lcd.fill(lcd.GRAY)                      # Fill the entire LCD with gray
-lcd.fill(lcd.WHITE)                     # Fill the entire LCD with white
-lcd.pixel(50, 50, lcd.BLUE)             # fills the pixels in the (50,50) position with blue
-lcd.text("hello RT-Thread", 0, 0, 16)   # prints the string at 16 font size at position (0, 0)
-lcd.text("hello RT-Thread", 0, 16, 24)  # prints the string at 24 font size at position (0, 16)
-lcd.text("hello RT-Thread", 0, 48, 32)  # prints the string at 32 font size at position (0, 48)
-lcd.line(0, 50, 239, 50)                # Draw a line starting at (0,50) and ending at (239,50)
-lcd.line(0, 50, 239, 50)                # Draw a line starting at (0,50) and ending at (239,50)
-lcd.rectangle(100, 100, 200, 200)       # Draw a rectangle with the top left corner (100,100) and the bottom right corner (200,200)
-lcd.circle(150, 150, 80)                # Draw a circle with a radius of 80 at the center (150,150)

+ 0 - 21
examples/stm32l4_pandora/pin.py

@@ -1,21 +0,0 @@
-# 
-# Copyright (c) 2006-2019, RT-Thread Development Team
-# 
-# SPDX-License-Identifier: MIT License
-# 
-# Change Logs:
-# Date           Author       Notes
-# 2019-06-13     SummerGift   first version
-#
-
-from machine import Pin
-
-PIN_OUT = 31   # PB15, get the pin number from get_pin_number.py
-PIN_IN  = 58   # PD10
-
-p_out = Pin(("PB15", PIN_OUT), Pin.OUT_PP)
-p_out.value(1)                 # set io high
-p_out.value(0)                 # set io low
-
-p_in = Pin(("key_0", PIN_IN), Pin.IN, Pin.PULL_UP)
-print(p_in.value() )           # get value, 0 or 1

+ 0 - 23
examples/stm32l4_pandora/pwm.py

@@ -1,23 +0,0 @@
-# 
-# Copyright (c) 2006-2019, RT-Thread Development Team
-# 
-# SPDX-License-Identifier: MIT License
-# 
-# Change Logs:
-# Date           Author       Notes
-# 2019-06-13     SummerGift   first version
-#
-
-from machine import PWM     # Import PWM class from machine
-
-pwm = PWM(3, 3, 1000, 100)  # Create PWM object. Currently, 3 channels of PWM device numbered 3 are used. 
-                            # The initialization frequency is 1000Hz and the duty ratio value is 100 (duty ratio is 100/255 = 39.22%).
-pwm.freq(2000)              # Set the frequency of PWM object
-pwm.freq()                  # Get the frequency of PWM object
-print(pwm)                  # Show PWM object information
-pwm.duty(200)               # Sets the duty ratio value of PWM object
-pwm.duty()                  # Get the duty ratio value of PWM object
-print(pwm)                  # Show PWM object information
-pwm.deinit()                # Close PWM object
-pwm.init(3, 1000, 100)      # Open and reconfigure the PWM object
-print(pwm)                  # Show PWM object information

+ 0 - 44
examples/stm32l4_pandora/rgb_led.py

@@ -1,44 +0,0 @@
-# 
-# Copyright (c) 2006-2019, RT-Thread Development Team
-# 
-# SPDX-License-Identifier: MIT License
-# 
-# Change Logs:
-# Date           Author       Notes
-# 2019-06-13     SummerGift   first version
-#
-
-import utime as time
-from machine import Pin
-
-PIN_LED_R = 71    # PE7, get the pin number from get_pin_number.py
-PIN_LED_G = 72    # PE8
-PIN_LED_B = 73    # PE9
-
-LED_ON  = 0
-LED_OFF = 1
-
-led_r = Pin(("LED RED", PIN_LED_R), Pin.OUT_PP)
-led_g = Pin(("LED GREEN", PIN_LED_G), Pin.OUT_PP)
-led_b = Pin(("LED BLUE", PIN_LED_B), Pin.OUT_PP)
-
-blink_tab = [(LED_ON, LED_ON, LED_ON),
-             (LED_OFF, LED_ON, LED_ON),
-             (LED_ON, LED_OFF, LED_ON),
-             (LED_ON, LED_ON, LED_OFF),
-             (LED_OFF, LED_OFF, LED_ON),
-             (LED_ON, LED_OFF, LED_OFF),
-             (LED_OFF, LED_ON, LED_OFF),
-             (LED_ON, LED_OFF, LED_OFF)]
-
-count = 0
-
-while True:
-    group_num = count % len(blink_tab)
-
-    led_r.value(blink_tab[group_num][0])           # set led status
-    led_g.value(blink_tab[group_num][1])
-    led_b.value(blink_tab[group_num][2])
-
-    count += 1
-    time.sleep(0.5)

+ 0 - 17
examples/stm32l4_pandora/rtc.py

@@ -1,17 +0,0 @@
-# 
-# Copyright (c) 2006-2019, RT-Thread Development Team
-# 
-# SPDX-License-Identifier: MIT License
-# 
-# Change Logs:
-# Date           Author       Notes
-# 2019-06-13     SummerGift   first version
-#
-
-from machine import RTC
-
-rtc = RTC()                            # Create an RTC device object
-rtc.init((2019,6,5,2,10,22,30,0))      # Set initialization time
-print(rtc.now())                       # Get the current time
-rtc.deinit()                           # Reset time to January 1, 2015
-print(rtc.now())                       # Get the current time

+ 0 - 25
examples/stm32l4_pandora/spi.py

@@ -1,25 +0,0 @@
-# 
-# Copyright (c) 2006-2019, RT-Thread Development Team
-# 
-# SPDX-License-Identifier: MIT License
-# 
-# Change Logs:
-# Date           Author       Notes
-# 2019-06-13     SummerGift   first version
-#
-
-from machine import Pin, SPI
-
-PIN_CLK  = 26   # PB10, get the pin number from get_pin_number.py
-PIN_MOSI = 27   # PB11
-PIN_MISO = 28   # PB12
-
-clk = Pin(("clk", PIN_CLK), Pin.OUT_PP)          # Select the PIN_CLK pin device as the clock
-mosi = Pin(("mosi", PIN_MOSI), Pin.OUT_PP)       # Select the PIN_MOSI pin device as the mosi
-miso = Pin(("miso", PIN_MISO), Pin.IN)           # Select the PIN_MISO pin device as the miso
-
-spi = SPI(-1, 500000, polarity = 0, phase = 0, bits = 8, firstbit = 0, sck = clk, mosi = mosi, miso = miso)
-print(spi)
-spi.write("hello rt-thread!")
-spi.read(10)
-

+ 0 - 27
examples/stm32l4_pandora/timer.py

@@ -1,27 +0,0 @@
-# 
-# Copyright (c) 2006-2019, RT-Thread Development Team
-# 
-# SPDX-License-Identifier: MIT License
-# 
-# Change Logs:
-# Date           Author       Notes
-# 2019-06-29     ChenYong     first version
-#
-
-def callback_periodic(obj):                                # defined  preiodic mode timeout callback
-    print("Timer callback periodic test")
-
-def callback_oneshot(obj):                                 # defined  ont shot mode timeout callback
-    print("Timer callback oneshot test")
-
-from machine import Timer
-import utime as time
-
-timer = Timer(15)                                          # Create Timer object. Timer device number 15 are used. 
-timer.init(timer.PERIODIC, 1000, callback_periodic)        # Initialize the Timer device object
-                                                           # Set Timer mode to preiodic mode, set timeout to 1 seconds and set callback fucntion
-time.sleep_ms(5500)                                        # Execute 5 times timeout callback in the delay time
-timer.init(timer.ONE_SHOT, 1000, callback_oneshot)         # Reset initialize the Timer device object
-                                                           # Set Timer mode to one shot mode, set timeout to 1 seconds and set callback fucntion
-time.sleep_ms(1500)                                        # Execute 1 times timeout callback in the delay time
-timer.deinit()                                             # Stop and close Timer device object

+ 0 - 18
examples/stm32l4_pandora/uart.py

@@ -1,18 +0,0 @@
-# 
-# Copyright (c) 2006-2019, RT-Thread Development Team
-# 
-# SPDX-License-Identifier: MIT License
-# 
-# Change Logs:
-# Date           Author       Notes
-# 2019-06-13     SummerGift   first version
-#
-
-from machine import UART
-
-uart = UART(1, 115200)                          # init with given baudrate
-uart.init(115200, bits=8, parity=None, stop=1)  # init with given parameters
-uart.read(10)                                   # read 10 characters, returns a bytes object
-uart.read()                                     # read all available characters
-uart.readline()                                 # read a line
-uart.write('abc')                               # write the 3 characters

+ 0 - 16
examples/stm32l4_pandora/wdt.py

@@ -1,16 +0,0 @@
-# 
-# Copyright (c) 2006-2019, RT-Thread Development Team
-# 
-# SPDX-License-Identifier: MIT License
-# 
-# Change Logs:
-# Date           Author       Notes
-# 2019-06-29     ChenYong     first version
-#
-
-from machine import WDT
-
-wdt = WDT(10)                # Create an WDT device object, set the timeout to 10 seconds
-wdt.feed()                   # Perform the "feed dog" operation to clear the watchdog device count during the timout period
-                             # If not executed, the system will restart after the timeout
-print("reset system after 10 seconds")