Changes between Version 2 and Version 3 of XIAO2040


Ignore:
Timestamp:
Apr 13, 2024, 3:41:57 PM (8 months ago)
Author:
katta
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • XIAO2040

    v2 v3  
    22
    33== XIAO RP2040
     4  * 2022/11/01 Amazon ¥1,419.-
    45
    56||[[Image(XiaoRP2040.png, 400)]]||
    67
    78[KhoPyboard PyBoard一覧に戻る]
     9
     10== XIAO RP2040 の動作ログ
     11  * USBケーブルで接続し、!TeraTerm で開くと MicroPython が動作している
     12
     13{{{
     14>>> help()
     15Welcome to MicroPython!
     16
     17For online help please visit https://micropython.org/help/.
     18
     19For access to the hardware use the 'machine' module.  RP2 specific commands
     20are in the 'rp2' module.
     21
     22Quick overview of some objects:
     23  machine.Pin(pin) -- get a pin, eg machine.Pin(0)
     24  machine.Pin(pin, m, [p]) -- get a pin and configure it for IO mode m, pull mode p
     25    methods: init(..), value([v]), high(), low(), irq(handler)
     26  machine.ADC(pin) -- make an analog object from a pin
     27    methods: read_u16()
     28  machine.PWM(pin) -- make a PWM object from a pin
     29    methods: deinit(), freq([f]), duty_u16([d]), duty_ns([d])
     30  machine.I2C(id) -- create an I2C object (id=0,1)
     31    methods: readfrom(addr, buf, stop=True), writeto(addr, buf, stop=True)
     32             readfrom_mem(addr, memaddr, arg), writeto_mem(addr, memaddr, arg)
     33  machine.SPI(id, baudrate=1000000) -- create an SPI object (id=0,1)
     34    methods: read(nbytes, write=0x00), write(buf), write_readinto(wr_buf, rd_buf)
     35  machine.Timer(freq, callback) -- create a software timer object
     36    eg: machine.Timer(freq=1, callback=lambda t:print(t))
     37
     38Pins are numbered 0-29, and 26-29 have ADC capabilities
     39Pin IO modes are: Pin.IN, Pin.OUT, Pin.ALT
     40Pin pull modes are: Pin.PULL_UP, Pin.PULL_DOWN
     41
     42Useful control commands:
     43  CTRL-C -- interrupt a running program
     44  CTRL-D -- on a blank line, do a soft reset of the board
     45  CTRL-E -- on a blank line, enter paste mode
     46
     47For further help on a specific object, type help(obj)
     48For a list of available modules, type help('modules')
     49>>>
     50>>> help('modules')
     51__main__          gc                uasyncio/event    umachine
     52_boot             lwip              uasyncio/funcs    uos
     53_boot_fat         math              uasyncio/lock     urandom
     54_onewire          micropython       uasyncio/stream   ure
     55_rp2              mip               ubinascii         urequests
     56_thread           neopixel          ucollections      uselect
     57_uasyncio         network           ucryptolib        usocket
     58_webrepl          ntptime           uctypes           ussl
     59builtins          onewire           uerrno            ustruct
     60cmath             rp2               uhashlib          usys
     61dht               uarray            uheapq            utime
     62ds18x20           uasyncio/__init__ uio               uwebsocket
     63framebuf          uasyncio/core     ujson             uzlib
     64Plus any modules on the filesystem
     65>>>
     66>>> help(rp2)
     67object <module 'rp2' from 'rp2.py'> is of type module
     68  country -- <function>
     69  PIOASMEmit -- <class 'PIOASMEmit'>
     70  __file__ -- rp2.py
     71  asm_pio -- <function asm_pio at 0x20008580>
     72  const -- <function>
     73  PIOASMError -- <class 'PIOASMError'>
     74  PIO -- <class 'PIO'>
     75  __name__ -- rp2
     76  asm_pio_encode -- <function asm_pio_encode at 0x200085a0>
     77  StateMachine -- <class 'StateMachine'>
     78  Flash -- <class 'Flash'>
     79  dht_readinto -- <function>
     80  _pio_funcs -- {'in_': None, 'y_dec': 4, 'pin': 6, 'iffull': 64, 'gpio': 0, 'not_osre': 7, 'clear': 64, 'rel': <function <lambda> at 0x20008a50>, 'wrap': None, 'x_not_y': 5, 'word': None, 'out': None, 'push': None, 'noblock': 1, 'pull': None, 'wrap_target': None, 'x_dec': 2, 'mov': None, 'irq': None, 'set': None, 'y': 2, 'x': 1, 'null': 3, 'pc': 5, 'invert': <function <lambda> at 0x20008a30>, 'pins': 0, 'not_x': 1, 'not_y': 3, 'ifempty': 64, 'isr': 6, 'pindirs': 4, 'exec': 8, 'label': None, 'status': 5, 'nop': None, 'osr': 7, 'block': 33, 'reverse': <function <lambda> at 0x20008a40>, 'jmp': None, 'wait': None}
     81>>>
     82}}}
     83
     84[KhoPyboard PyBoard一覧に戻る]