Changes between Version 5 and Version 6 of PybLite


Ignore:
Timestamp:
Apr 13, 2024, 3:01:11 PM (5 weeks ago)
Author:
katta
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PybLite

    v5 v6  
    1212
    1313[KhoPyboard PyBoard一覧に戻る]
     14
     15== PybLITE1.0 動作ログ
     16  * 既に、MicroPython は実装されており、USBケーブルで、接続し !TeraTerm で開く
     17  * 2022/11/30 の記録
     18
     19{{{
     20MicroPython v1.13 on 2020-09-02; PYBLITEv1.0 with STM32F411RE
     21Type "help()" for more information.
     22>>> help()
     23Welcome to MicroPython!
     24
     25For online help please visit http://micropython.org/help/.
     26
     27Quick overview of commands for the board:
     28  pyb.info()    -- print some general information
     29  pyb.delay(n)  -- wait for n milliseconds
     30  pyb.millis()  -- get number of milliseconds since hard reset
     31  pyb.Switch()  -- create a switch object
     32                   Switch methods: (), callback(f)
     33  pyb.LED(n)    -- create an LED object for LED n (n=1,2,3,4)
     34                   LED methods: on(), off(), toggle(), intensity(<n>)
     35  pyb.Pin(pin)  -- get a pin, eg pyb.Pin('X1')
     36  pyb.Pin(pin, m, [p]) -- get a pin and configure it for IO mode m, pull mode p
     37                   Pin methods: init(..), value([v]), high(), low()
     38  pyb.ExtInt(pin, m, p, callback) -- create an external interrupt object
     39  pyb.ADC(pin)  -- make an analog object from a pin
     40                   ADC methods: read(), read_timed(buf, freq)
     41  pyb.DAC(port) -- make a DAC object
     42                   DAC methods: triangle(freq), write(n), write_timed(buf, freq)
     43  pyb.RTC()     -- make an RTC object; methods: datetime([val])
     44  pyb.rng()     -- get a 30-bit hardware random number
     45  pyb.Servo(n)  -- create Servo object for servo n (n=1,2,3,4)
     46                   Servo methods: calibration(..), angle([x, [t]]), speed([x, [t]])
     47  pyb.Accel()   -- create an Accelerometer object
     48                   Accelerometer methods: x(), y(), z(), tilt(), filtered_xyz()
     49
     50Pins are numbered X1-X12, X17-X22, Y1-Y12, or by their MCU name
     51Pin IO modes are: pyb.Pin.IN, pyb.Pin.OUT_PP, pyb.Pin.OUT_OD
     52Pin pull modes are: pyb.Pin.PULL_NONE, pyb.Pin.PULL_UP, pyb.Pin.PULL_DOWN
     53Additional serial bus objects: pyb.I2C(n), pyb.SPI(n), pyb.UART(n)
     54
     55Control commands:
     56  CTRL-A        -- on a blank line, enter raw REPL mode
     57  CTRL-B        -- on a blank line, enter normal REPL mode
     58  CTRL-C        -- interrupt a running program
     59  CTRL-D        -- on a blank line, do a soft reset of the board
     60  CTRL-E        -- on a blank line, enter paste mode
     61
     62For further help on a specific object, type help(obj)
     63For a list of available modules, type help('modules')
     64>>>
     65}}}
     66
     67  * モジュール pyb を調べる
     68
     69{{{
     70>>> import pyb
     71>>> pyb.info()
     72ID=4b004d00:03513431:34383038
     73S=96000000
     74H=96000000
     75P1=24000000
     76P2=48000000
     77_etext=806d798
     78_sidata=806d7a0
     79_sdata=20000000
     80_edata=2000001c
     81_sbss=2000001c
     82_ebss=2000627c
     83_sstack=2001bff8
     84_estack=2001fff8
     85_ram_start=20000000
     86_heap_start=2000627c
     87_heap_end=2001bff8
     88_ram_end=20020000
     89qstr:
     90  n_pool=1
     91  n_qstr=3
     92  n_str_data_bytes=28
     93  n_total_bytes=124
     94GC:
     95  87360 total
     96  1616 : 85744
     97  1=26 2=6 m=40
     98LFS free: 41472 bytes
     99>>>
     100>>> help(pyb.LED)
     101object <class 'LED'> is of type type
     102  on -- <function>
     103  off -- <function>
     104  toggle -- <function>
     105  intensity -- <function>
     106>>>
     107}}}
     108
     109  * LED を試してみる
     110
     111{{{
     112>>> red = pyb.LED(1)
     113>>> red.on()
     114>>> red.toggle()
     115>>> grn = pyb.LED(2)
     116>>> grn.on()
     117>>> grn.toggle()
     118>>> ylw = pyb.LED(3)
     119>>> ylw.on()
     120>>> ylw.toggle()
     121>>> blu = pyb.LED(4)
     122>>> blu.on()
     123>>> blu.toggle()
     124>>>
     125}}}
     126
     127[KhoPyboard PyBoard一覧に戻る]