-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmicropython_help.txt
46 lines (41 loc) · 2.17 KB
/
micropython_help.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Executing main.py
Micro Python v1.2-59-gecb5792 on 2014-08-11; Teensy-3.1 with MK20DX256
Type "help()" for more information.
>>>
>>> help()
Welcome to Micro Python!
For online help please visit http://micropython.org/help/.
Quick overview of commands for the board:
pyb.info() -- print some general information
pyb.gc() -- run the garbage collector
pyb.delay(n) -- wait for n milliseconds
pyb.Switch() -- create a switch object
Switch methods: (), callback(f)
pyb.LED(n) -- create an LED object for LED n (n=1,2,3,4)
LED methods: on(), off(), toggle(), intensity(<n>)
pyb.Pin(pin) -- get a pin, eg pyb.Pin('X1')
pyb.Pin(pin, m, [p]) -- get a pin and configure it for IO mode m, pull mode p
Pin methods: init(..), value([v]), high(), low()
pyb.ExtInt(pin, m, p, callback) -- create an external interrupt object
pyb.ADC(pin) -- make an analog object from a pin
ADC methods: read(), read_timed(buf, freq)
pyb.DAC(port) -- make a DAC object
DAC methods: triangle(freq), write(n), write_timed(buf, freq)
pyb.RTC() -- make an RTC object; methods: datetime([val])
pyb.rng() -- get a 30-bit hardware random number
pyb.Servo(n) -- create Servo object for servo n (n=1,2,3,4)
Servo methods: calibration(..), angle([x, [t]]), speed([x, [t]])
pyb.Accel() -- create an Accelerometer object
Accelerometer methods: x(), y(), z(), tilt(), filtered_xyz()
Pins are numbered X1-X12, X17-X22, Y1-Y12, or by their MCU name
Pin IO modes are: pyb.Pin.IN, pyb.Pin.OUT_PP, pyb.Pin.OUT_OD
Pin pull modes are: pyb.Pin.PULL_NONE, pyb.Pin.PULL_UP, pyb.Pin.PULL_DOWN
Additional serial bus objects: pyb.I2C(n), pyb.SPI(n), pyb.UART(n)
Control commands:
CTRL-A -- on a blank line, enter raw REPL mode
CTRL-B -- on a blank line, enter normal REPL mode
CTRL-C -- interrupt a running program
CTRL-D -- on a blank line, do a soft reset of the board
For further help on a specific object, type help(obj)
>>>
CTRL-A Z for help |115200 8N1 | NOR | Minicom 2.6.1 | VT102 | Offline