Pin - Control I/O Pins

This class provides methods of reading and writing GPIO. A pin object is used to control I/O pins (also known as GPIO - general-purpose input/output). The pin class has methods to set the mode of the pin (IN, OUT, etc) and methods to get and set the digital logic level.

Example:

from machine import Pin

# Creates a GPIO object
gpio1 = Pin(Pin.GPIO1, Pin.OUT, Pin.PULL_DISABLE, 1)

# Gets the pin level
gpio1.read()

# Sets the pin level
gpio1.write(0)
gpio1.write(1)

# Sets input and output modes
gpio1.set_dir(Pin.IN)
gpio1.set_dir(Pin.OUT)

# Gets input and output modes
gpio1.get_dir()

Constructor

machine.Pin

class machine.Pin(GPIOn, direction, pullMode, level)

Parameter:

  • GPIOn - Integer type. GPIO number. Click here to view the mapping relationship between GPIO pin numbers and physical pins.
  • direction - Integer type. I/O mode. IN - Input mode. OUT - Output mode.
  • pullMode - Integer type. Pull selection mode. Descriptions are as follows:
    PULL_DISABLE - Floating mode
    PULL_PU - Pull-up mode
    PULL_PD - Pull-down mode
  • level - Integer type. Pin level. 0 - Set pin to low level. 1 - Set pin to high level.

Example:

>>> # Creates a GPIO object
>>> from machine import Pin
>>> gpio1 = Pin(Pin.GPIO1, Pin.OUT, Pin.PULL_DISABLE, 0)

Mapping Relationship Between GPIO Pin Numbers and Physical Pins:

Description of GPIO corresponding pin numbers: GPIO pin numbers provided in the document correspond to external pin numbers of the module. For example, for EC600M-CN module, GPIO1 corresponds to pin10, which is an external pin number of the module. See the provided hardware documents for external pin numbers of the module.

GPIO number Pin number
GPIO1 Pin10
GPIO2 Pin11
GPIO3 Pin12
GPIO4 Pin13
GPIO5 Pin14
GPIO6 Pin15
GPIO7 Pin16
GPIO8 Pin39
GPIO9 Pin40
GPIO10 Pin48
GPIO11 Pin58
GPIO12 Pin59
GPIO13 Pin60
GPIO14 Pin61
GPIO15 Pin62
GPIO16 Pin63
GPIO17 Pin69
GPIO18 Pin70
GPIO19 Pin1
GPIO20 Pin3
GPIO21 Pin49
GPIO22 Pin50
GPIO23 Pin51
GPIO24 Pin52
GPIO25 Pin53
GPIO26 Pin54
GPIO27 Pin55
GPIO28 Pin56
GPIO29 Pin57
GPIO30 Pin2
GPIO31 Pin66
GPIO32 Pin65
GPIO33 Pin67
GPIO34 Pin64
GPIO35 Pin4
GPIO36 Pin31
GPIO37 Pin32
GPIO38 Pin33
GPIO39 Pin34
GPIO40 Pin71
GPIO41 Pin72
GPIO42 Pin109
GPIO43 Pin110
GPIO44 Pin112
GPIO45 Pin111
GPIO number Pin number
GPIO1 Pin61 (It cannot be used together with GPIO31.)
GPIO2 Pin58 (It cannot be used together with GPIO32.)
GPIO3 Pin34 (It cannot be used together with GPIO41.)
GPIO4 Pin60 (It cannot be used together with GPIO34.)
GPIO5 Pin69 (It cannot be used together with GPIO35.)
GPIO6 Pin70 (It cannot be used together with GPIO36.)
GPIO7 Pin123 (It cannot be used together with GPIO43.)
GPIO8 Pin118
GPIO9 Pin9 (It cannot be used together with GPIO47.)
GPIO10 Pin1 (It cannot be used together with GPIO37.)
GPIO11 Pin4 (It cannot be used together with GPIO38.)
GPIO12 Pin3 (It cannot be used together with GPIO39.)
GPIO13 Pin2 (It cannot be used together with GPIO40.)
GPIO14 Pin54
GPIO15 Pin57
GPIO16 Pin56
GPIO17 Pin12
GPIO18 Pin33 (It cannot be used together with GPIO42.)
GPIO19 Pin124 (It cannot be used together with GPIO44.)
GPIO20 Pin122 (It cannot be used together with GPIO45.)
GPIO21 Pin121 (It cannot be used together with GPIO46.)
GPIO22 Pin48
GPIO23 Pin39
GPIO24 Pin40
GPIO25 Pin49
GPIO26 Pin50
GPIO27 Pin53
GPIO28 Pin52
GPIO29 Pin51
GPIO30 Pin59 (It cannot be used together with GPIO33.)
GPIO31 Pin66 (It cannot be used together with GPIO1.)
GPIO32 Pin63 (It cannot be used together with GPIO2.)
GPIO33 Pin67 (It cannot be used together with GPIO30.)
GPIO34 Pin65 (It cannot be used together with GPIO4.)
GPIO35 Pin137 (It cannot be used together with GPIO5.)
GPIO36 Pin62 (It cannot be used together with GPIO6.)
GPIO37 Pin98 (It cannot be used together with GPIO10.)
GPIO38 Pin95 (It cannot be used together with GPIO11.)
GPIO39 Pin119 (It cannot be used together with GPIO12.)
GPIO40 Pin100 (It cannot be used together with GPIO13.)
GPIO41 Pin120 (It cannot be used together with GPIO3.)
GPIO42 Pin16 (It cannot be used together with GPIO18.)
GPIO43 Pin10 (It cannot be used together with GPIO7.)
GPIO44 Pin14 (It cannot be used together with GPIO19.)
GPIO45 Pin15 (It cannot be used together with GPIO20.)
GPIO46 Pin13 (It cannot be used together with GPIO21.)
GPIO47 Pin99 (It cannot be used together with GPIO9.)
GPIO number Pin number
GPIO1 Pin27 (It cannot be used together with GPIO31.)
GPIO2 Pin26 (It cannot be used together with GPIO32.)
GPIO3 Pin24 (It cannot be used together with GPIO33.)
GPIO4 Pin25 (It cannot be used together with GPIO34.)
GPIO5 Pin13 (It cannot be used together with GPIO17.)
GPIO6 Pin135 (It cannot be used together with GPIO36.)
GPIO7 Pin136 (It cannot be used together with GPIO44.)
GPIO8 Pin133
GPIO9 Pin3 (It cannot be used together with GPIO37.)
GPIO10 Pin40 (It cannot be used together with GPIO38.)
GPIO11 Pin37 (It cannot be used together with GPIO39.)
GPIO12 Pin38 (It cannot be used together with GPIO40.)
GPIO13 Pin39 (It cannot be used together with GPIO41.)
GPIO14 Pin5
GPIO15 Pin141
GPIO16 Pin142
GPIO17 Pin121 (It cannot be used together with GPIO5.)
GPIO18 Pin65 (It cannot be used together with GPIO42.)
GPIO19 Pin64 (It cannot be used together with GPIO43.)
GPIO20 Pin139 (It cannot be used together with GPIO45.)
GPIO21 Pin126 (It cannot be used together with GPIO46.)
GPIO22 Pin127 (It cannot be used together with GPIO47.)
GPIO23 Pin33
GPIO24 Pin31
GPIO25 Pin30
GPIO26 Pin29
GPIO27 Pin28
GPIO28 Pin1
GPIO29 Pin2
GPIO30 Pin4
GPIO31 Pin125 (It cannot be used together with GPIO1.)
GPIO32 Pin124 (It cannot be used together with GPIO2.)
GPIO33 Pin123 (It cannot be used together with GPIO3.)
GPIO34 Pin122 (It cannot be used together with GPIO4.)
GPIO35 Pin42
GPIO36 Pin119 (It cannot be used together with GPIO6.)
GPIO37 Pin134 (It cannot be used together with GPIO9.)
GPIO38 Pin132 (It cannot be used together with GPIO10.)
GPIO39 Pin131 (It cannot be used together with GPIO11.)
GPIO40 Pin130 (It cannot be used together with GPIO12.)
GPIO41 Pin129 (It cannot be used together with GPIO13.)
GPIO42 Pin61 (It cannot be used together with GPIO18.)
GPIO43 Pin62 (It cannot be used together with GPIO19.)
GPIO44 Pin63 (It cannot be used together with GPIO7.)
GPIO45 Pin66 (It cannot be used together with GPIO20.)
GPIO46 Pin6 (It cannot be used together with GPIO21.)
GPIO47 Pin23 (It cannot be used together with GPIO22.)
GPIO number Pin number
GPIO1 Pin27
GPIO2 Pin26
GPIO3 Pin24
GPIO4 Pin25
GPIO5 Pin5
GPIO6 Pin135
GPIO7 Pin136
GPIO8 Pin68
GPIO9 Pin3
GPIO10 Pin40
GPIO11 Pin37
GPIO12 Pin38
GPIO13 Pin39
GPIO14 Pin67
GPIO15 Pin13
GPIO18 Pin65
GPIO19 Pin64
GPIO20 Pin139
GPIO22 Pin127
GPIO27 Pin28
GPIO28 Pin1
GPIO29 Pin2
GPIO30 Pin4
GPIO35 Pin42
GPIO36 Pin119
GPIO43 Pin62
GPIO44 Pin63
GPIO45 Pin66
GPIO46 Pin6
GPIO47 Pin23
GPIO number Pin number
GPIO1 Pin30
GPIO2 Pin31
GPIO3 Pin32
GPIO4 Pin33
GPIO5 Pin49
GPIO6 Pin50
GPIO7 Pin51
GPIO8 Pin52
GPIO9 Pin53
GPIO10 Pin54
GPIO11 Pin55
GPIO12 Pin56
GPIO13 Pin57
GPIO14 Pin58
GPIO15 Pin80
GPIO16 Pin81
GPIO17 Pin76
GPIO18 Pin77
GPIO19 Pin82
GPIO20 Pin83
GPIO21 Pin86
GPIO22 Pin87
GPIO23 Pin66
GPIO24 Pin67
GPIO25 Pin17
GPIO26 Pin18
GPIO27 Pin19
GPIO28 Pin20
GPIO29 Pin21
GPIO30 Pin22
GPIO31 Pin23
GPIO32 Pin28
GPIO33 Pin29
GPIO34 Pin38
GPIO35 Pin39
GPIO36 Pin16
GPIO37 Pin78
GPIO number Pin number
GPIO1 Pin3
GPIO2 Pin4
GPIO3 Pin5
GPIO4 Pin6
GPIO5 Pin16
GPIO6 Pin20
GPIO7 Pin21
GPIO8 Pin22
GPIO9 Pin23
GPIO10 Pin25
GPIO11 Pin28
GPIO12 Pin29
GPIO13 Pin30
GPIO14 Pin31
GPIO15 Pin32
GPIO16 Pin33
GPIO17 Pin2
GPIO18 Pin8
GPIO number Pin number
GPIO1 Pin4
GPIO2 Pin5
GPIO3 Pin6
GPIO4 Pin7
GPIO5 Pin18
GPIO6 Pin19
GPIO7 Pin22
GPIO8 Pin23
GPIO9 Pin25
GPIO10 Pin26
GPIO11 Pin27
GPIO12 Pin28
GPIO13 Pin40
GPIO14 Pin41
GPIO15 Pin64
GPIO16 Pin65
GPIO17 Pin66
GPIO18 Pin85
GPIO19 Pin86
GPIO20 Pin87
GPIO21 Pin88
GPIO22 Pin20
GPIO23 Pin21
GPIO24 Pin30
GPIO25 Pin34
GPIO26 Pin35
GPIO27 Pin36
GPIO28 Pin37
GPIO29 Pin38
GPIO30 Pin39
GPIO number Pin number
GPIO1 Pin4 (It cannot be used together with GPIO41.)
GPIO2 Pin5 (It cannot be used together with GPIO36.)
GPIO3 Pin6 (It cannot be used together with GPIO35.)
GPIO4 Pin7 (It cannot be used together with GPIO24.)
GPIO5 Pin18
GPIO6 Pin19
GPIO7 Pin1 (It cannot be used together with GPIO37.)
GPIO8 Pin38
GPIO9 Pin25
GPIO10 Pin26
GPIO11 Pin27 (It cannot be used together with GPIO32.)
GPIO12 Pin28 (It cannot be used together with GPIO31.)
GPIO13 Pin40
GPIO14 Pin41
GPIO15 Pin64
GPIO16 Pin20 (It cannot be used together with GPIO30.)
GPIO17 Pin21
GPIO18 Pin85 (It cannot be reused when using the dual-SIM standby function.)
GPIO19 Pin86 (It cannot be reused when using the dual-SIM standby function.)
GPIO20 Pin30
GPIO21 Pin88
GPIO22 Pin36 (It cannot be used together with GPIO40.)
GPIO23 Pin37 (It cannot be used together with GPIO38.)
GPIO24 Pin16 (It cannot be used together with GPIO4.)
GPIO25 Pin39
GPIO26 Pin42 (It cannot be used together with GPIO27.)
GPIO27 Pin78 (It cannot be used together with GPIO26.)
GPIO28 Pin83 (It cannot be used together with GPIO33.)
GPIO29 Pin84 (It cannot be reused when using the dual-SIM standby function.)
GPIO30 Pin92 (It cannot be used together with GPIO16.)
GPIO31 Pin95 (It cannot be used together with GPIO12.)
GPIO32 Pin97 (It cannot be used together with GPIO11.)
GPIO33 Pin98 (It cannot be used together with GPIO28.)
GPIO34 Pin104
GPIO35 Pin105 (It cannot be used together with GPIO3.)
GPIO36 Pin106 (It cannot be used together with GPIO2.)
GPIO37 Pin108 (It cannot be used together with GPIO4.)
GPIO38 Pin111 (It cannot be used together with GPIO23.)
GPIO39 Pin114
GPIO40 Pin115 (It cannot be used together with GPIO22.)
GPIO41 Pin116 (It cannot be used together with GPIO1.)
GPIO number Pin number
GPIO1 Pin30
GPIO2 Pin31
GPIO3 Pin32
GPIO4 Pin33
GPIO5 Pin49
GPIO6 Pin50
GPIO7 Pin51
GPIO8 Pin52
GPIO9 Pin53
GPIO10 Pin54
GPIO11 Pin55
GPIO12 Pin56
GPIO13 Pin57
GPIO14 Pin58
GPIO15 Pin80
GPIO16 Pin81
GPIO17 Pin76
GPIO18 Pin77
GPIO19 Pin82
GPIO20 Pin83
GPIO21 Pin86(EG810M_EU unsupported)
GPIO22 Pin87(EG810M_EU unsupported)
GPIO23 Pin66
GPIO24 Pin67
GPIO25 Pin17
GPIO26 Pin18
GPIO27 Pin19
GPIO28 Pin20
GPIO29 Pin21
GPIO30 Pin22
GPIO31 Pin23
GPIO32 Pin28
GPIO33 Pin29
GPIO34 Pin38
GPIO35 Pin39
GPIO36 Pin16
GPIO37 Pin78
GPIO38 Pin68
GPIO39 Pin69
GPIO40 Pin74
GPIO41 Pin75
GPIO42 Pin84(EG810M_EU unsupported)
GPIO43 Pin85(EG810M_EU unsupported)
GPIO44 Pin25
GPIO45 Pin105
GPIO46 Pin104
GPIO47 Pin79
GPIO number Pin number
GPIO1 Pin4
GPIO2 Pin5
GPIO3 Pin6
GPIO4 Pin7
GPIO5 Pin18
GPIO6 Pin19
GPIO7 Pin1
GPIO8 Pin16
GPIO9 Pin25
GPIO10 Pin26
GPIO11 Pin27
GPIO12 Pin28
GPIO13 Pin40
GPIO14 Pin41
GPIO15 Pin64
GPIO16 Pin20
GPIO17 Pin21
GPIO18 Pin30
GPIO19 Pin34
GPIO20 Pin35
GPIO21 Pin36
GPIO22 Pin37
GPIO23 Pin38
GPIO24 Pin39
GPIO25 Pin42
GPIO26 Pin78
GPIO27 Pin83
GPIO28 Pin92
GPIO29 Pin95
GPIO30 Pin96
GPIO31 Pin97
GPIO32 Pin98
GPIO33 Pin103
GPIO34 Pin104
GPIO35 Pin105
GPIO36 Pin106
GPIO37 Pin107
GPIO38 Pin114
GPIO39 Pin115
GPIO40 Pin116
GPIO number Pin number
GPIO1 Pin10(I&PU)
GPIO2 Pin11(57)(I&PU)(It cannot be used together with GPIO41)
GPIO3 Pin12(56)(I&PU)(It cannot be used together with GPIO40)
GPIO4 Pin13(I&PU)
GPIO5 Pin14(I&PU)
GPIO6 Pin15(I&PU)
GPIO7 Pin16(I&PU)
GPIO8 Pin39(I&PD)
GPIO9 Pin40(I&PU)
GPIO10 Pin48(I&PD)
GPIO11 Pin58(I&PD)
GPIO12 Pin59(I&PD)
GPIO13 Pin60(I&PD)(It cannot be used together with GPIO36)
GPIO14 Pin61(I&PD)
GPIO15 Pin62(I&PU)(EC600ECN_LE&LQ Unavailable)
GPIO16 Pin63(I&PD)(EC600ECN_LE&LQ Unavailable)
GPIO17 Pin69(I&PU)(EC600ECN_LE&LQ Unavailable)
GPIO18 Pin70(I&PU)(EC600ECN_LE&LQ Unavailable)
GPIO22 Pin50(I&PD)
GPIO23 Pin51(I&PD)
GPIO24 Pin52(I&PD)
GPIO25 Pin53(I&PD)
GPIO26 Pin54(I&PD)
GPIO31 Pin66(I&PU)(EC600ECN_LE&LQ Unavailable)
GPIO32 Pin65(I&PU)(EC600ECN_LE&LQ Unavailable)
GPIO33 Pin67(I&PU)(EC600ECN_LE&LQ Unavailable)
GPIO34 Pin64(I&PU)(EC600ECN_LE&LQ Unavailable)
GPIO36 Pin31(I&PU)(It cannot be used together with GPIO13)
GPIO37 Pin32(I&PU)
GPIO38 Pin33(I&PU)
GPIO39 Pin34(I&PU)
GPIO40 Pin71(I&PU)(It cannot be used together with GPIO3)
GPIO41 Pin72(I&PU)(It cannot be used together with GPIO2)
GPIO number Pin number
GPIO1 Pin30(I&PD)
GPIO2 Pin31(I&PD)
GPIO3 Pin32(I&PD)
GPIO4 Pin33(I&PD)(It cannot be used together with GPIO25)
GPIO5 Pin49(I&PD)(EC800ECN_LE&LQ&CG Unavailable)
GPIO6 Pin50(I&PU)(EC800ECN_LE&LQ&CG Unavailable)
GPIO7 Pin51(I&PU)(EC800ECN_LE&LQ&CG Unavailable)
GPIO8 Pin52(I&PU)(EC800ECN_LE&LQ&CG Unavailable)
GPIO9 Pin53(I&PU)(EC800ECN_LE&LQ&CG Unavailable)
GPIO10 Pin54(I&PU)(EC800ECN_LE&LQ&CG Unavailable)
GPIO11 Pin55(I&PU)(EC800ECN_LE&LQ&CG Unavailable,It cannot be used together with Pin64)
GPIO12 Pin56(I&PU)(EC800ECN_LE&LQ&CG Unavailable)
GPIO13 Pin57(67)(I&PU)(EC800ECN_LE&LQ&CG pin number 57 cannot be used)(It cannot be used together with GPIO34)
GPIO14 Pin58(66)(I&PU)(EC800ECN_LE&LQ&CG Pin number 58 cannot be used)(It cannot be used together with GPIO35)
GPIO15 Pin80(I&PU)(EC800ECN_LE&LQ&CG Unavailable,It cannot be used together with Pin64)
GPIO16 Pin81(I&PU)(EC800ECN_LE&LQ&CG Unavailable,It cannot be used together with Pin64)
GPIO17 Pin25(I&PD)
GPIO25 Pin17(I&PU)(It cannot be used together with GPIO4)
GPIO26 Pin18(I&PU)
GPIO27 Pin19(I&PD)
GPIO28 Pin20(I&PU)
GPIO29 Pin21(I&PD)
GPIO30 Pin22(I&PU)
GPIO31 Pin23(I&PU)
GPIO32 Pin28(I&PU)
GPIO33 Pin29(I&PU)
GPIO34 Pin38(I&PU)(It cannot be used together with GPIO13)
GPIO35 Pin39(I&PU)(It cannot be used together with GPIO14)
GPIO36 Pin16(I&PD)
GPIO37 Pin78(I&PU)(EC800ECN_LE&LQ&CG Unavailable)
GPIO38 Pin85(I&PD)(EC800ECN_LE&LQ&LC&CG Unavailable)
GPIO39 Pin108(I&PD)(EC800ECN_LE&LQ&LC&CG Unavailable)
GPIO40 Pin109(I&PD)(EC800ECN_LE&LQ&LC&CG Unavailable)
GPIO number Pin number
GPIO1 Pin30
GPIO2 Pin31
GPIO3 Pin32
GPIO4 Pin33
GPIO5 Pin49
GPIO6 Pin50
GPIO7 Pin51
GPIO8 Pin52
GPIO9 Pin53
GPIO10 Pin54
GPIO12 Pin56
GPIO13 Pin57
GPIO14 Pin58
GPIO17 Pin25(AGPIO)
GPIO23 Pin66(It cannot be used together with GPIO26)
GPIO24 Pin67(It cannot be used together with GPIO25)
GPIO25 Pin17(It cannot be used together with GPIO24)
GPIO26 Pin18(It cannot be used together with GPIO23)
GPIO27 Pin19(AGPIO, the driving ability is weak, it is recommended to use only as an input pin)
GPIO28 Pin20(AGPIO)
GPIO29 Pin21(AGPIO)
GPIO30 Pin22
GPIO31 Pin23
GPIO32 Pin28
GPIO33 Pin29
GPIO34 Pin38
GPIO35 Pin39
GPIO36 Pin16(AGPIO)
GPIO37 Pin78
GPIO38 Pin85(AGPIO)
GPIO39 Pin108(AGPIO, the driving ability is weak, it is recommended to use only as an input pin)
GPIO40 Pin109(AGPIO, the driving ability is weak, it is recommended to use only as an input pin)
GPIO41 Pin101
GPIO number Pin number
GPIO1 Pin61(It cannot be used together with GPIO24)
GPIO2 Pin58(It cannot be used together with GPIO25)
GPIO3 Pin34
GPIO4 Pin60
GPIO5 Pin69(It cannot be used together with GPIO10)
GPIO6 Pin70(It cannot be used together with GPIO11)
GPIO7 Pin123
GPIO8 Pin132
GPIO9 Pin9
GPIO10 Pin1(It cannot be used together with GPIO5)
GPIO11 Pin4(It cannot be used together with GPIO6)
GPIO12 Pin3
GPIO13 Pin2
GPIO14 Pin54
GPIO15 Pin57
GPIO16 Pin56
GPIO17 Pin12
GPIO18 Pin33
GPIO19 Pin124(It cannot be used together with GPIO37)
GPIO20 Pin104
GPIO21 Pin103
GPIO22 Pin48
GPIO23 Pin39(It cannot be used together with GPIO46)
GPIO24 Pin40(It cannot be used together with GPIO1)
GPIO25 Pin49(It cannot be used together with GPIO2)
GPIO26 Pin50(It cannot be used together with GPIO30)
GPIO27 Pin53
GPIO28 Pin52
GPIO29 Pin51
GPIO30 Pin59(It cannot be used together with GPIO26)
GPIO31 Pin66
GPIO32 Pin63
GPIO33 Pin67
GPIO34 Pin65
GPIO35 Pin137
GPIO36 Pin62
GPIO37 Pin105(It cannot be used together with GPIO19)
GPIO38 Pin106
GPIO39 Pin107
GPIO40 Pin126
GPIO41 Pin120
GPIO42 Pin16
GPIO43 Pin10
GPIO44 Pin14
GPIO45 Pin64
GPIO46 Pin13(It cannot be used together with GPIO23)
GPIO47 Pin116
GPIO48 Pin31
GPIO number Pin number
GPIO1 Pin30(It cannot be used together with GPIO45)
GPIO2 Pin31(It cannot be used together with GPIO46)
GPIO3 Pin32(It cannot be used together with GPIO47)
GPIO4 Pin33(It cannot be used together with GPIO48)
GPIO5 Pin49
GPIO6 Pin50(It cannot be used together with GPIO50)
GPIO7 Pin51
GPIO8 Pin52
GPIO9 Pin53
GPIO10 Pin54
GPIO11 Pin55
GPIO12 Pin25
GPIO13 Pin57(It cannot be used together with GPIO49)
GPIO14 Pin58(It cannot be used together with GPIO20)
GPIO15 Pin84
GPIO16 Pin81
GPIO17 Pin76(It cannot be used together with GPIO35)
GPIO18 Pin77
GPIO19 Pin82
GPIO20 Pin83(It cannot be used together with GPIO14)
GPIO21 Pin86(It cannot be used together with GPIO34)
GPIO22 Pin87
GPIO23 Pin66
GPIO24 Pin67
GPIO25 Pin17
GPIO26 Pin18
GPIO27 Pin19
GPIO28 Pin20
GPIO29 Pin21
GPIO30 Pin22
GPIO31 Pin23
GPIO32 Pin28
GPIO33 Pin29
GPIO34 Pin38(It cannot be used together with GPIO21)
GPIO35 Pin39(It cannot be used together with GPIO17)
GPIO36 Pin16
GPIO37 Pin78
GPIO38 Pin85
GPIO39 Pin68
GPIO40 Pin69
GPIO41 Pin80(It cannot be used together with GPIO44)
GPIO42 Pin107
GPIO43 Pin103
GPIO44 Pin101(It cannot be used together with GPIO41)
GPIO45 Pin79(It cannot be used together with GPIO1)
GPIO46 Pin100(It cannot be used together with GPIO2)
GPIO47 Pin108(It cannot be used together with GPIO3)
GPIO48 Pin109(It cannot be used together with GPIO4)
GPIO49 Pin75(It cannot be used together with GPIO13)
GPIO50 Pin74(It cannot be used together with GPIO6)
GPIO number Pin number
GPIO1 Pin4(It cannot be used together with GPIO40)
GPIO2 Pin5(It cannot be used together with GPIO36)
GPIO3 Pin6(It cannot be used together with GPIO35)
GPIO4 Pin7(It cannot be used together with GPIO8)
GPIO5 Pin18
GPIO6 Pin19
GPIO7 Pin1(It cannot be used together with GPIO19)
GPIO8 Pin16(It cannot be used together with GPIO4)
GPIO10 Pin26(EG912UGuLAA unsupported)
GPIO11 Pin27(It cannot be used together with GPIO31)
GPIO12 Pin28(It cannot be used together with GPIO29)
GPIO13 Pin40
GPIO14 Pin41
GPIO15 Pin64(EG912UGLAA unsupported)
GPIO16 Pin20(It cannot be used together with GPIO28)
GPIO17 Pin21
GPIO18 Pin30
GPIO19 Pin108(It cannot be used together with GPIO7)
GPIO20 Pin88(EG912UGLAA unsupported)
GPIO21 Pin36(It cannot be used together with GPIO39)
GPIO22 Pin37(It cannot be used together with GPIO30)
GPIO23 Pin38
GPIO24 Pin39
GPIO25 Pin42(It cannot be used together with GPIO26)
GPIO26 Pin78(It cannot be used together with GPIO25)
GPIO27 Pin83(It cannot be used together with GPIO32)
GPIO28 Pin92(It cannot be used together with GPIO16)
GPIO29 Pin95(It cannot be used together with GPIO12)
GPIO30 Pin111(It cannot be used together with GPIO22)
GPIO31 Pin97(It cannot be used together with GPIO11)
GPIO32 Pin98(It cannot be used together with GPIO27)
GPIO34 Pin104
GPIO35 Pin105(It cannot be used together with GPIO3)
GPIO36 Pin106(It cannot be used together with GPIO2)
GPIO38 Pin114
GPIO39 Pin115(It cannot be used together with GPIO21)
GPIO40 Pin116(It cannot be used together with GPIO1)
GPIO number Pin number
GPIO1 Pin10
GPIO2 Pin11
GPIO3 Pin12
GPIO4 Pin13
GPIO5 Pin14
GPIO6 Pin15
GPIO7 Pin16
GPIO8 Pin39
GPIO9 Pin40
GPIO10 Pin48
GPIO11 Pin58
GPIO12 Pin59
GPIO13 Pin60
GPIO14 Pin61
GPIO15 Pin62
GPIO16 Pin63
GPIO17 Pin69
GPIO18 Pin70
GPIO19 Pin1
GPIO20 Pin3
GPIO21 Pin49
GPIO22 Pin50
GPIO23 Pin51
GPIO24 Pin52
GPIO25 Pin53
GPIO26 Pin54
GPIO27 Pin55(boot pin, internal pull-up)
GPIO28 Pin56
GPIO29 Pin57
GPIO30 Pin2
GPIO31 Pin66
GPIO32 Pin65
GPIO33 Pin67
GPIO34 Pin64
GPIO35 Pin4
GPIO36 Pin31
GPIO37 Pin32
GPIO38 Pin33
GPIO39 Pin34
GPIO number Pin number
GPIO1 Pin30
GPIO2 Pin31
GPIO3 Pin32
GPIO4 Pin33
GPIO5 Pin49
GPIO6 Pin50
GPIO7 Pin51
GPIO8 Pin52
GPIO9 Pin53
GPIO10 Pin54(The EG800KCN is unavailable)
GPIO11 Pin55(The EG800KCN is unavailable)
GPIO12 Pin56(The EG800KCN is unavailable)
GPIO13 Pin57(The EG800KCN is unavailable)
GPIO14 Pin58(The EG800KCN is unavailable)
GPIO15 Pin80(The EG800KCN is unavailable)
GPIO16 Pin81
GPIO17 Pin76
GPIO18 Pin77
GPIO19 Pin82
GPIO21 Pin86
GPIO22 Pin87
GPIO23 Pin66
GPIO24 Pin67
GPIO25 Pin17
GPIO26 Pin18
GPIO27 Pin19
GPIO28 Pin20
GPIO29 Pin21
GPIO30 Pin22
GPIO31 Pin23
GPIO32 Pin28(The EG800KCN is unavailable)
GPIO33 Pin29(The EG800KCN is unavailable)
GPIO36 Pin16
GPIO37 Pin78
GPIO38 Pin68
GPIO39 Pin69
GPIO40 Pin74
GPIO41 Pin75
GPIO44 Pin25
GPIO47 Pin79
Pin number
Pin6
Pin7
Pin8
Pin9
Pin10
Pin12
Pin13
Pin14
Pin15
Pin16
Pin19
Pin20
Pin21
Pin22
Pin23
Pin29
Pin number
Pin6
Pin7
Pin8
Pin9
Pin10
Pin12
Pin13
Pin14
Pin15
Pin16
Pin19
Pin20
Pin21
Pin22
Pin23
Pin29
Pin number
Pin6
Pin7
Pin8
Pin9
Pin14
Pin15
Pin16
Pin27
Pin28
Pin29
Pin30
Pin31
Pin34
Pin35
Pin37
GPIO number Pin number
GPIO1 Pin12
GPIO2 Pin13
GPIO3 Pin41
GPIO4 Pin42
GPIO5 Pin21
GPIO6 Pin22
GPIO7 Pin23
GPIO8 Pin24
GPIO9 Pin26
GPIO10 Pin43
GPIO11 Pin44
GPIO number Pin number
GPIO1 Pin12
GPIO2 Pin13
GPIO3 Pin41
GPIO4 Pin42
GPIO5 Pin21
GPIO6 Pin22
GPIO7 Pin23
GPIO8 Pin24
GPIO9 Pin26
GPIO10 Pin43
GPIO11 Pin44
GPIO number Pin number
GPIO1 Pin4
GPIO2 Pin5
GPIO3 Pin6
GPIO4 Pin7
GPIO5 Pin18
GPIO6 Pin19
GPIO7 Pin1
GPIO8 Pin38
GPIO9 Pin25
GPIO10 Pin26
GPIO11 Pin27
GPIO12 Pin28
GPIO13 Pin40
GPIO14 Pin41
GPIO15 Pin64
GPIO16 Pin20
GPIO17 Pin21
GPIO18 Pin34
GPIO19 Pin35
GPIO20 Pin30
GPIO21 Pin22
GPIO22 Pin36
GPIO23 Pin37
GPIO24 Pin16
GPIO25 Pin39
GPIO26 Pin23
GPIO27 Pin78
GPIO28 Pin83
GPIO29 Pin107
GPIO30 Pin92
GPIO31 Pin95
GPIO32 Pin97
GPIO33 Pin98
GPIO34 Pin104
GPIO35 Pin105
GPIO36 Pin106
GPIO37 Pin103
GPIO38 Pin96
GPIO39 Pin114
GPIO40 Pin115
GPIO41 Pin116

Note:

1.I&PU: In the input mode, only the floating and pull-up modes are supported

2.I&PD: In the input mode, only floating and drop-down modes are supported

3.The ExtInt function of the EC600E does not support both rising and falling edges to trigger an interrupt

Note:

1.I&PU: In the input mode, only the floating and pull-up modes are supported

2.I&PD: In the input mode, only floating and drop-down modes are supported

3.EC800ECN_LE&LQ&CG Unavailable: The pin of this model module is suspended internally, so it cannot be used

4.Pin67, Pin66, Pin57, and Pin58 of the module share the same internal IO, that is, when the level of GPIO13 is changed, Pin57 and Pin67 will change simultaneously

5.On the module of EC800ECN_LE&LQ&CG model, Pin57 and Pin58 are suspended internally, so only Pin67 and Pin66 can be used as GPIO13 and 14

6. The ExtInt function of the EC800E does not support the simultaneous rise and fall of the ExTINt edge

7.Pin55, 80, and 81 cannot be used with Pin64, 63, and 62 (SIM2 pins), respectively

Note:

1.When AGPIO is in sleep mode, the level state remains unchanged, while the level of ordinary GPIO cannot be maintained during sleep

2.GPIO27, GPIO39, and GPIO40 have weak driving capabilities, so it is recommended to use them only as input pins

Methods

Pin.read

Pin.read()

This method reads the pin level.

Return Value:

Pin level. 0 - low level. 1 - high level.

Pin.write

Pin.write(value)

This method sets the pin level.

Note: You need to ensure that the pin is in the output mode before you set the pin level.

Parameter:

  • value - Integer type. Pin level. 0 - low level. 1 - high level.

Return Value:

0 - Successful execution

-1 - Failed execution

Example:

>>> from machine import Pin
>>> gpio1 = Pin(Pin.GPIO1, Pin.OUT, Pin.PULL_DISABLE, 0)
>>> gpio1.write(1)
0
>>> gpio1.read()
1

Pin.set_dir

Pin.set_dir(value)

This method sets I/O mode of the pin.

Parameter:

  • value - Integer type. I/O mode of the pin. 0 - Input mode. 1 - Output mode.

Return Value:

0 - Successful execution

-1 - Failed execution

Pin.get_dir

Pin.get_dir()

This method gets I/O mode of the pin.

Return Value:

I/O mode of pins.

0 - Input mode.

1 - Output mode.

Example:

>>> from machine import Pin
>>> gpio1 = Pin(Pin.GPIO1, Pin.OUT, Pin.PULL_DISABLE, 0)
>>> gpio1.get_dir()
1
>>> gpio1.set_dir(Pin.IN)
0
>>> gpio1.get_dir()
0

Constants

Constant Description
Pin.GPIO1 GPIO1
Pin.GPIO2 GPIO2
Pin.GPIO3 GPIO3
Pin.GPIO4 GPIO4
Pin.GPIO5 GPIO5
Pin.GPIO6 GPIO6
Pin.GPIO7 GPIO7
Pin.GPIO8 GPIO8
Pin.GPIO9 GPIO9
Pin.GPIO10 GPIO10
Pin.GPIO11 GPIO11
Pin.GPIO12 GPIO12
Pin.GPIO13 GPIO13
Pin.GPIO14 GPIO14
Pin.GPIO15 GPIO15
Pin.GPIO16 GPIO16
Pin.GPIO17 GPIO17
Pin.GPIO18 GPIO18
Pin.GPIO19 GPIO19
Pin.GPIO20 GPIO20
Pin.GPIO21 GPIO21
Pin.GPIO22 GPIO22
Pin.GPIO23 GPIO23
Pin.GPIO24 GPIO24
Pin.GPIO25 GPIO25
Pin.GPIO26 GPIO26
Pin.GPIO27 GPIO27
Pin.GPIO28 GPIO28
Pin.GPIO29 GPIO29
Pin.GPIO30 GPIO30
Pin.GPIO31 GPIO31
Pin.GPIO32 GPIO32
Pin.GPIO33 GPIO33
Pin.GPIO34 GPIO34
Pin.GPIO35 GPIO35
Pin.GPIO36 GPIO36
Pin.GPIO37 GPIO37
Pin.GPIO38 GPIO38
Pin.GPIO39 GPIO39
Pin.GPIO40 GPIO40
Pin.GPIO41 GPIO41
Pin.GPIO42 GPIO42
Pin.GPIO43 GPIO43
Pin.GPIO44 GPIO44
Pin.GPIO45 GPIO45
Pin.IN Input mode
Pin.OUT Output mode
Pin.PULL_DISABLE Floating mode
Pin.PULL_PU Pull-up mode
Pin.PULL_PD Pull-down mode
>
Constant Description
Pin.GPIO1 GPIO1
Pin.GPIO2 GPIO2
Pin.GPIO3 GPIO3
Pin.GPIO4 GPIO4
Pin.GPIO5 GPIO5
Pin.GPIO6 GPIO6
Pin.GPIO7 GPIO7
Pin.GPIO8 GPIO8
Pin.GPIO9 GPIO9
Pin.GPIO10 GPIO10
Pin.GPIO11 GPIO11
Pin.GPIO12 GPIO12
Pin.GPIO13 GPIO13
Pin.GPIO14 GPIO14
Pin.GPIO15 GPIO15
Pin.GPIO16 GPIO16
Pin.GPIO17 GPIO17
Pin.GPIO18 GPIO18
Pin.GPIO19 GPIO19
Pin.GPIO20 GPIO20
Pin.GPIO21 GPIO21
Pin.GPIO22 GPIO22
Pin.GPIO23 GPIO23
Pin.GPIO24 GPIO24
Pin.GPIO25 GPIO25
Pin.GPIO26 GPIO26
Pin.GPIO27 GPIO27
Pin.GPIO28 GPIO28
Pin.GPIO29 GPIO29
Pin.GPIO30 GPIO30
Pin.GPIO31 GPIO31
Pin.GPIO32 GPIO32
Pin.GPIO33 GPIO33
Pin.GPIO34 GPIO34
Pin.GPIO35 GPIO35
Pin.GPIO36 GPIO36
Pin.GPIO37 GPIO37
Pin.GPIO38 GPIO38
Pin.GPIO39 GPIO39
Pin.GPIO40 GPIO40
Pin.GPIO41 GPIO41
Pin.GPIO42 GPIO42
Pin.GPIO43 GPIO43
Pin.GPIO44 GPIO44
Pin.GPIO45 GPIO45
Pin.GPIO46 GPIO46
Pin.GPIO47 GPIO47
Pin.IN Input mode
Pin.OUT Output mode
Pin.PULL_DISABLE Floating mode
Pin.PULL_PU Pull-up mode
Pin.PULL_PD Pull-down mode
Constant Description
Pin.GPIO1 GPIO1
Pin.GPIO2 GPIO2
Pin.GPIO3 GPIO3
Pin.GPIO4 GPIO4
Pin.GPIO5 GPIO5
Pin.GPIO6 GPIO6
Pin.GPIO7 GPIO7
Pin.GPIO8 GPIO8
Pin.GPIO9 GPIO9
Pin.GPIO10 GPIO10
Pin.GPIO11 GPIO11
Pin.GPIO12 GPIO12
Pin.GPIO13 GPIO13
Pin.GPIO14 GPIO14
Pin.GPIO15 GPIO15
Pin.GPIO16 GPIO16
Pin.GPIO17 GPIO17
Pin.GPIO18 GPIO18
Pin.GPIO19 GPIO19
Pin.GPIO20 GPIO20
Pin.GPIO21 GPIO21
Pin.GPIO22 GPIO22
Pin.GPIO23 GPIO23
Pin.GPIO24 GPIO24
Pin.GPIO25 GPIO25
Pin.GPIO26 GPIO26
Pin.GPIO27 GPIO27
Pin.GPIO28 GPIO28
Pin.GPIO29 GPIO29
Pin.GPIO30 GPIO30
Pin.GPIO31 GPIO31
Pin.GPIO32 GPIO32
Pin.GPIO33 GPIO33
Pin.GPIO34 GPIO34
Pin.GPIO35 GPIO35
Pin.GPIO36 GPIO36
Pin.GPIO37 GPIO37
Pin.GPIO38 GPIO38
Pin.GPIO39 GPIO39
Pin.GPIO40 GPIO40
Pin.GPIO41 GPIO41
Pin.GPIO42 GPIO42
Pin.GPIO43 GPIO43
Pin.GPIO44 GPIO44
Pin.GPIO45 GPIO45
Pin.GPIO46 GPIO46
Pin.GPIO47 GPIO47
Pin.IN Input mode
Pin.OUT Output mode
Pin.PULL_DISABLE Floating mode
Pin.PULL_PU Pull-up mode
Pin.PULL_PD Pull-down mode
Constant Description
Pin.GPIO1 GPIO1
Pin.GPIO2 GPIO2
Pin.GPIO3 GPIO3
Pin.GPIO4 GPIO4
Pin.GPIO5 GPIO5
Pin.GPIO6 GPIO6
Pin.GPIO7 GPIO7
Pin.GPIO9 GPIO9
Pin.GPIO10 GPIO10
Pin.GPIO11 GPIO11
Pin.GPIO12 GPIO12
Pin.GPIO13 GPIO13
Pin.GPIO18 GPIO18
Pin.GPIO19 GPIO19
Pin.GPIO20 GPIO20
Pin.GPIO22 GPIO22
Pin.GPIO28 GPIO28
Pin.GPIO29 GPIO29
Pin.GPIO30 GPIO30
Pin.GPIO35 GPIO35
Pin.GPIO36 GPIO36
Pin.GPIO43 GPIO43
Pin.GPIO44 GPIO44
Pin.GPIO45 GPIO45
Pin.GPIO46 GPIO46
Pin.GPIO47 GPIO47
Pin.IN Input mode
Pin.OUT Output mode
Pin.PULL_DISABLE Floating mode
Pin.PULL_PU Pull-up mode
Pin.PULL_PD Pull-down mode
Constant Description
Pin.GPIO1 GPIO1
Pin.GPIO2 GPIO2
Pin.GPIO3 GPIO3
Pin.GPIO4 GPIO4
Pin.GPIO5 GPIO5
Pin.GPIO6 GPIO6
Pin.GPIO7 GPIO7
Pin.GPIO8 GPIO8
Pin.GPIO9 GPIO9
Pin.GPIO10 GPIO10
Pin.GPIO11 GPIO11
Pin.GPIO12 GPIO12
Pin.GPIO13 GPIO13
Pin.GPIO14 GPIO14
Pin.GPIO15 GPIO15
Pin.GPIO16 GPIO16
Pin.GPIO17 GPIO17
Pin.GPIO18 GPIO18
Pin.GPIO19 GPIO19
Pin.GPIO20 GPIO20
Pin.GPIO21 GPIO21
Pin.GPIO22 GPIO22
Pin.GPIO23 GPIO23
Pin.GPIO24 GPIO24
Pin.GPIO25 GPIO25
Pin.GPIO26 GPIO26
Pin.GPIO27 GPIO27
Pin.GPIO28 GPIO28
Pin.GPIO29 GPIO29
Pin.GPIO30 GPIO30
Pin.GPIO31 GPIO31
Pin.GPIO32 GPIO32
Pin.GPIO33 GPIO33
Pin.GPIO34 GPIO34
Pin.GPIO35 GPIO35
Pin.GPIO36 GPIO36
Pin.GPIO37 GPIO37
Pin.IN Input mode
Pin.OUT Output mode
Pin.PULL_DISABLE Floating mode
Pin.PULL_PU Pull-up mode
Pin.PULL_PD Pull-down mode
Constant Description
Pin.GPIO1 GPIO1
Pin.GPIO2 GPIO2
Pin.GPIO3 GPIO3
Pin.GPIO4 GPIO4
Pin.GPIO5 GPIO5
Pin.GPIO6 GPIO6
Pin.GPIO7 GPIO7
Pin.GPIO8 GPIO8
Pin.GPIO9 GPIO9
Pin.GPIO10 GPIO10
Pin.GPIO11 GPIO11
Pin.GPIO12 GPIO12
Pin.GPIO13 GPIO13
Pin.GPIO14 GPIO14
Pin.GPIO15 GPIO15
Pin.GPIO16 GPIO16
Pin.GPIO17 GPIO17
Pin.GPIO18 GPIO18
Pin.IN Input mode
Pin.OUT Output mode
Pin.PULL_DISABLE Floating mode
Pin.PULL_PU Pull-up mode
Pin.PULL_PD Pull-down mode
Constant Description
Pin.GPIO1 GPIO1
Pin.GPIO2 GPIO2
Pin.GPIO3 GPIO3
Pin.GPIO4 GPIO4
Pin.GPIO5 GPIO5
Pin.GPIO6 GPIO6
Pin.GPIO7 GPIO7
Pin.GPIO8 GPIO8
Pin.GPIO9 GPIO9
Pin.GPIO10 GPIO10
Pin.GPIO11 GPIO11
Pin.GPIO12 GPIO12
Pin.GPIO13 GPIO13
Pin.GPIO14 GPIO14
Pin.GPIO15 GPIO15
Pin.GPIO16 GPIO16
Pin.GPIO17 GPIO17
Pin.GPIO18 GPIO18
Pin.GPIO19 GPIO19
Pin.GPIO20 GPIO20
Pin.GPIO21 GPIO21
Pin.IN Input mode
Pin.OUT Output mode
Pin.PULL_DISABLE Floating mode
Pin.PULL_PU Pull-up mode
Pin.PULL_PD Pull-down mode
Constant Description
Pin.GPIO1 GPIO1
Pin.GPIO2 GPIO2
Pin.GPIO3 GPIO3
Pin.GPIO4 GPIO4
Pin.GPIO5 GPIO5
Pin.GPIO6 GPIO6
Pin.GPIO7 GPIO7
Pin.GPIO8 GPIO8
Pin.GPIO9 GPIO9
Pin.GPIO10 GPIO10
Pin.GPIO11 GPIO11
Pin.GPIO12 GPIO12
Pin.GPIO13 GPIO13
Pin.GPIO14 GPIO14
Pin.GPIO15 GPIO15
Pin.GPIO16 GPIO16
Pin.GPIO17 GPIO17
Pin.GPIO18 GPIO18
Pin.GPIO19 GPIO19
Pin.GPIO20 GPIO20
Pin.GPIO21 GPIO21
Pin.GPIO22 GPIO22
Pin.GPIO23 GPIO23
Pin.GPIO24 GPIO24
Pin.GPIO25 GPIO25
Pin.GPIO26 GPIO26
Pin.GPIO27 GPIO27
Pin.GPIO28 GPIO28
Pin.GPIO29 GPIO29
Pin.GPIO30 GPIO30
Pin.GPIO31 GPIO31
Pin.GPIO32 GPIO32
Pin.GPIO33 GPIO33
Pin.GPIO34 GPIO34
Pin.GPIO35 GPIO35
Pin.GPIO36 GPIO36
Pin.GPIO37 GPIO37
Pin.GPIO38 GPIO38
Pin.GPIO39 GPIO39
Pin.GPIO40 GPIO40
Pin.GPIO41 GPIO41
Pin.IN Input mode
Pin.OUT Output mode
Pin.PULL_DISABLE Floating mode
Pin.PULL_PU Pull-up mode
Pin.PULL_PD Pull-down mode
Constant Description
Pin.GPIO1 GPIO1
Pin.GPIO2 GPIO2
Pin.GPIO3 GPIO3
Pin.GPIO4 GPIO4
Pin.GPIO5 GPIO5
Pin.GPIO6 GPIO6
Pin.GPIO7 GPIO7
Pin.GPIO8 GPIO8
Pin.GPIO9 GPIO9
Pin.GPIO10 GPIO10
Pin.GPIO11 GPIO11
Pin.GPIO12 GPIO12
Pin.GPIO13 GPIO13
Pin.GPIO14 GPIO14
Pin.GPIO15 GPIO15
Pin.GPIO16 GPIO16
Pin.GPIO17 GPIO17
Pin.GPIO18 GPIO18
Pin.GPIO19 GPIO19
Pin.GPIO20 GPIO20
Pin.GPIO21 GPIO21
Pin.GPIO22 GPIO22
Pin.GPIO23 GPIO23
Pin.GPIO24 GPIO24
Pin.GPIO25 GPIO25
Pin.GPIO26 GPIO26
Pin.GPIO27 GPIO27
Pin.GPIO28 GPIO28
Pin.GPIO29 GPIO29
Pin.GPIO30 GPIO30
Pin.GPIO31 GPIO31
Pin.GPIO32 GPIO32
Pin.GPIO33 GPIO33
Pin.GPIO34 GPIO34
Pin.GPIO35 GPIO35
Pin.GPIO36 GPIO36
Pin.GPIO37 GPIO37
Pin.GPIO38 GPIO38
Pin.GPIO39 GPIO39
Pin.GPIO40 GPIO40
Pin.GPIO41 GPIO41
Pin.GPIO42 GPIO42
Pin.GPIO43 GPIO43
Pin.GPIO44 GPIO44
Pin.IN Input mode
Pin.OUT Output mode
Pin.PULL_DISABLE Floating mode
Pin.PULL_PU Pull-up mode
Pin.PULL_PD Pull-down mode
Constant Description
Pin.GPIO1 GPIO1
Pin.GPIO2 GPIO2
Pin.GPIO3 GPIO3
Pin.GPIO4 GPIO4
Pin.GPIO5 GPIO5
Pin.GPIO6 GPIO6
Pin.GPIO7 GPIO7
Pin.GPIO8 GPIO8
Pin.GPIO9 GPIO9
Pin.GPIO10 GPIO10
Pin.GPIO11 GPIO11
Pin.GPIO12 GPIO12
Pin.GPIO13 GPIO13
Pin.GPIO14 GPIO14
Pin.GPIO15 GPIO15
Pin.GPIO16 GPIO16
Pin.GPIO17 GPIO17
Pin.GPIO18 GPIO18
Pin.GPIO19 GPIO19
Pin.GPIO20 GPIO20
Pin.GPIO21 GPIO21
Pin.GPIO22 GPIO22
Pin.GPIO23 GPIO23
Pin.GPIO24 GPIO24
Pin.GPIO25 GPIO25
Pin.GPIO26 GPIO26
Pin.GPIO27 GPIO27
Pin.GPIO28 GPIO28
Pin.GPIO29 GPIO29
Pin.GPIO30 GPIO30
Pin.GPIO31 GPIO31
Pin.GPIO32 GPIO32
Pin.GPIO33 GPIO33
Pin.GPIO34 GPIO34
Pin.GPIO35 GPIO35
Pin.GPIO36 GPIO36
Pin.GPIO37 GPIO37
Pin.GPIO38 GPIO38
Pin.GPIO39 GPIO39
Pin.GPIO40 GPIO40
Pin.IN Input mode
Pin.OUT Output mode
Pin.PULL_DISABLE Floating mode
Pin.PULL_PU Pull-up mode
Pin.PULL_PD Pull-down mode
Constant Description
Pin.GPIO1 GPIO1
Pin.GPIO2 GPIO2
Pin.GPIO3 GPIO3
Pin.GPIO4 GPIO4
Pin.GPIO5 GPIO5
Pin.GPIO6 GPIO6
Pin.GPIO7 GPIO7
Pin.GPIO8 GPIO8
Pin.GPIO9 GPIO9
Pin.GPIO10 GPIO10
Pin.GPIO11 GPIO11
Pin.GPIO12 GPIO12
Pin.GPIO13 GPIO13
Pin.GPIO14 GPIO14
Pin.GPIO15 GPIO15
Pin.GPIO16 GPIO16
Pin.GPIO17 GPIO17
Pin.GPIO18 GPIO18
Pin.GPIO22 GPIO22
Pin.GPIO23 GPIO23
Pin.GPIO24 GPIO24
Pin.GPIO25 GPIO25
Pin.GPIO26 GPIO26
Pin.GPIO31 GPIO31
Pin.GPIO32 GPIO32
Pin.GPIO33 GPIO33
Pin.GPIO34 GPIO34
Pin.GPIO37 GPIO37
Pin.GPIO38 GPIO38
Pin.GPIO39 GPIO39
Pin.GPIO40 GPIO40
Pin.GPIO41 GPIO41
Pin.IN Input mode
Pin.OUT Output mode
Pin.PULL_DISABLE Floating mode
Pin.PULL_PU Pull-up mode
Pin.PULL_PD Pull-down mode
Constant Description
Pin.GPIO1 GPIO1
Pin.GPIO2 GPIO2
Pin.GPIO3 GPIO3
Pin.GPIO4 GPIO4
Pin.GPIO5 GPIO5
Pin.GPIO6 GPIO6
Pin.GPIO7 GPIO7
Pin.GPIO8 GPIO8
Pin.GPIO9 GPIO9
Pin.GPIO10 GPIO10
Pin.GPIO11 GPIO11
Pin.GPIO12 GPIO12
Pin.GPIO13 GPIO13
Pin.GPIO14 GPIO14
Pin.GPIO15 GPIO15
Pin.GPIO16 GPIO16
Pin.GPIO17 GPIO17
Pin.GPIO25 GPIO25
Pin.GPIO26 GPIO26
Pin.GPIO27 GPIO27
Pin.GPIO28 GPIO28
Pin.GPIO29 GPIO29
Pin.GPIO30 GPIO30
Pin.GPIO31 GPIO31
Pin.GPIO32 GPIO32
Pin.GPIO33 GPIO33
Pin.GPIO34 GPIO34
Pin.GPIO35 GPIO35
Pin.GPIO36 GPIO36
Pin.GPIO37 GPIO37
Pin.GPIO38 GPIO38
Pin.GPIO39 GPIO39
Pin.GPIO40 GPIO40
Pin.GPIO41 GPIO41
Pin.IN Input mode
Pin.OUT Output mode
Pin.PULL_DISABLE Floating mode
Pin.PULL_PU Pull-up mode
Pin.PULL_PD Pull-down mode
Constant Description
Pin.GPIO1 GPIO1
Pin.GPIO2 GPIO2
Pin.GPIO3 GPIO3
Pin.GPIO4 GPIO4
Pin.GPIO5 GPIO5
Pin.GPIO6 GPIO6
Pin.GPIO7 GPIO7
Pin.GPIO8 GPIO8
Pin.GPIO9 GPIO9
Pin.GPIO10 GPIO10
Pin.GPIO12 GPIO12
Pin.GPIO13 GPIO13
Pin.GPIO14 GPIO14
Pin.GPIO17 GPIO17
Pin.GPIO23 GPIO23
Pin.GPIO24 GPIO24
Pin.GPIO25 GPIO25
Pin.GPIO26 GPIO26
Pin.GPIO27 GPIO27
Pin.GPIO28 GPIO28
Pin.GPIO29 GPIO29
Pin.GPIO30 GPIO30
Pin.GPIO31 GPIO31
Pin.GPIO32 GPIO32
Pin.GPIO33 GPIO33
Pin.GPIO34 GPIO34
Pin.GPIO35 GPIO35
Pin.GPIO36 GPIO36
Pin.GPIO37 GPIO37
Pin.GPIO38 GPIO38
Pin.GPIO39 GPIO39
Pin.GPIO40 GPIO40
Pin.GPIO41 GPIO41
Pin.IN Input mode
Pin.OUT Output mode
Pin.PULL_DISABLE Floating mode
Pin.PULL_PU Pull-up mode
Pin.PULL_PD Pull-down mode
Constant Description
Pin.GPIO1 GPIO1
Pin.GPIO2 GPIO2
Pin.GPIO3 GPIO3
Pin.GPIO4 GPIO4
Pin.GPIO5 GPIO5
Pin.GPIO6 GPIO6
Pin.GPIO7 GPIO7
Pin.GPIO8 GPIO8
Pin.GPIO9 GPIO9
Pin.GPIO10 GPIO10
Pin.GPIO11 GPIO11
Pin.GPIO12 GPIO12
Pin.GPIO13 GPIO13
Pin.GPIO14 GPIO14
Pin.GPIO15 GPIO15
Pin.GPIO16 GPIO16
Pin.GPIO17 GPIO17
Pin.GPIO18 GPIO18
Pin.GPIO19 GPIO19
Pin.GPIO20 GPIO20
Pin.GPIO21 GPIO21
Pin.GPIO22 GPIO22
Pin.GPIO23 GPIO23
Pin.GPIO24 GPIO24
Pin.GPIO25 GPIO25
Pin.GPIO26 GPIO26
Pin.GPIO27 GPIO27
Pin.GPIO28 GPIO28
Pin.GPIO29 GPIO29
Pin.GPIO30 GPIO30
Pin.GPIO31 GPIO31
Pin.GPIO32 GPIO32
Pin.GPIO33 GPIO33
Pin.GPIO34 GPIO34
Pin.GPIO35 GPIO35
Pin.GPIO36 GPIO36
Pin.GPIO37 GPIO37
Pin.GPIO38 GPIO38
Pin.GPIO39 GPIO39
Pin.GPIO40 GPIO40
Pin.GPIO41 GPIO41
Pin.GPIO42 GPIO42
Pin.GPIO43 GPIO43
Pin.GPIO44 GPIO44
Pin.GPIO45 GPIO45
Pin.GPIO46 GPIO46
Pin.IN Input mode
Pin.OUT Output mode
Pin.PULL_DISABLE Floating mode
Pin.PULL_PU Pull-up mode
Pin.PULL_PD Pull-down mode
Constant Description
Pin.GPIO1 GPIO1
Pin.GPIO2 GPIO2
Pin.GPIO3 GPIO3
Pin.GPIO4 GPIO4
Pin.GPIO5 GPIO5
Pin.GPIO6 GPIO6
Pin.GPIO7 GPIO7
Pin.GPIO8 GPIO8
Pin.GPIO9 GPIO9
Pin.GPIO10 GPIO10
Pin.GPIO11 GPIO11
Pin.GPIO12 GPIO12
Pin.GPIO13 GPIO13
Pin.GPIO14 GPIO14
Pin.GPIO15 GPIO15
Pin.GPIO16 GPIO16
Pin.GPIO17 GPIO17
Pin.GPIO18 GPIO18
Pin.GPIO19 GPIO19
Pin.GPIO20 GPIO20
Pin.GPIO21 GPIO21
Pin.GPIO22 GPIO22
Pin.GPIO23 GPIO23
Pin.GPIO24 GPIO24
Pin.GPIO25 GPIO25
Pin.GPIO26 GPIO26
Pin.GPIO27 GPIO27
Pin.GPIO28 GPIO28
Pin.GPIO29 GPIO29
Pin.GPIO30 GPIO30
Pin.GPIO31 GPIO31
Pin.GPIO32 GPIO32
Pin.GPIO33 GPIO33
Pin.GPIO34 GPIO34
Pin.GPIO35 GPIO35
Pin.GPIO36 GPIO36
Pin.GPIO37 GPIO37
Pin.GPIO38 GPIO38
Pin.GPIO39 GPIO39
Pin.GPIO40 GPIO40
Pin.GPIO41 GPIO41
Pin.GPIO42 GPIO42
Pin.GPIO43 GPIO43
Pin.GPIO44 GPIO44
Pin.GPIO45 GPIO45
Pin.GPIO46 GPIO46
Pin.GPIO47 GPIO47
Pin.GPIO48 GPIO48
Pin.GPIO49 GPIO49
Pin.GPIO50 GPIO50
Pin.IN Input mode
Pin.OUT Output mode
Pin.PULL_DISABLE Floating mode
Pin.PULL_PU Pull-up mode
Pin.PULL_PD Pull-down mode
Constant Description
Pin.GPIO1 GPIO1
Pin.GPIO2 GPIO2
Pin.GPIO3 GPIO3
Pin.GPIO4 GPIO4
Pin.GPIO5 GPIO5
Pin.GPIO6 GPIO6
Pin.GPIO7 GPIO7
Pin.GPIO8 GPIO8
Pin.GPIO10 GPIO10
Pin.GPIO11 GPIO11
Pin.GPIO12 GPIO12
Pin.GPIO13 GPIO13
Pin.GPIO14 GPIO14
Pin.GPIO15 GPIO15
Pin.GPIO16 GPIO16
Pin.GPIO17 GPIO17
Pin.GPIO18 GPIO18
Pin.GPIO19 GPIO19
Pin.GPIO20 GPIO20
Pin.GPIO21 GPIO21
Pin.GPIO22 GPIO22
Pin.GPIO23 GPIO23
Pin.GPIO24 GPIO24
Pin.GPIO25 GPIO25
Pin.GPIO26 GPIO26
Pin.GPIO27 GPIO27
Pin.GPIO28 GPIO28
Pin.GPIO29 GPIO29
Pin.GPIO30 GPIO30
Pin.GPIO31 GPIO31
Pin.GPIO32 GPIO32
Pin.GPIO34 GPIO34
Pin.GPIO35 GPIO35
Pin.GPIO36 GPIO36
Pin.GPIO38 GPIO38
Pin.GPIO39 GPIO39
Pin.GPIO40 GPIO40
Pin.IN Input mode
Pin.OUT Output mode
Pin.PULL_DISABLE Floating mode
Pin.PULL_PU Pull-up mode
Pin.PULL_PD Pull-down mode
Constant Description
Pin.GPIO1 GPIO1
Pin.GPIO2 GPIO2
Pin.GPIO3 GPIO3
Pin.GPIO4 GPIO4
Pin.GPIO5 GPIO5
Pin.GPIO6 GPIO6
Pin.GPIO7 GPIO7
Pin.GPIO8 GPIO8
Pin.GPIO9 GPIO9
Pin.GPIO10 GPIO10
Pin.GPIO11 GPIO11
Pin.GPIO12 GPIO12
Pin.GPIO13 GPIO13
Pin.GPIO14 GPIO14
Pin.GPIO15 GPIO15
Pin.GPIO16 GPIO16
Pin.GPIO17 GPIO17
Pin.GPIO18 GPIO18
Pin.GPIO19 GPIO19
Pin.GPIO20 GPIO20
Pin.GPIO21 GPIO21
Pin.GPIO22 GPIO22
Pin.GPIO23 GPIO23
Pin.GPIO24 GPIO24
Pin.GPIO25 GPIO25
Pin.GPIO26 GPIO26
Pin.GPIO27 GPIO27
Pin.GPIO28 GPIO28
Pin.GPIO29 GPIO29
Pin.GPIO30 GPIO30
Pin.GPIO31 GPIO31
Pin.GPIO32 GPIO32
Pin.GPIO33 GPIO33
Pin.GPIO34 GPIO34
Pin.GPIO35 GPIO35
Pin.GPIO36 GPIO36
Pin.GPIO37 GPIO37
Pin.GPIO38 GPIO38
Pin.GPIO39 GPIO39
Pin.IN Input mode
Pin.OUT Output mode
Pin.PULL_DISABLE Floating mode
Pin.PULL_PU Pull-up mode
Pin.PULL_PD Pull-down mode
Constant Description
Pin.GPIO1 GPIO1
Pin.GPIO2 GPIO2
Pin.GPIO3 GPIO3
Pin.GPIO4 GPIO4
Pin.GPIO5 GPIO5
Pin.GPIO6 GPIO6
Pin.GPIO7 GPIO7
Pin.GPIO8 GPIO8
Pin.GPIO9 GPIO9
Pin.GPIO10 GPIO10
Pin.GPIO11 GPIO11
Pin.GPIO12 GPIO12
Pin.GPIO13 GPIO13
Pin.GPIO14 GPIO14
Pin.GPIO15 GPIO15
Pin.GPIO16 GPIO16
Pin.GPIO17 GPIO17
Pin.GPIO18 GPIO18
Pin.GPIO19 GPIO19
Pin.GPIO20 GPIO20
Pin.GPIO21 GPIO21
Pin.GPIO22 GPIO22
Pin.GPIO23 GPIO23
Pin.GPIO24 GPIO24
Pin.GPIO25 GPIO25
Pin.GPIO26 GPIO26
Pin.GPIO27 GPIO27
Pin.GPIO28 GPIO28
Pin.GPIO29 GPIO29
Pin.GPIO30 GPIO30
Pin.GPIO31 GPIO31
Pin.GPIO32 GPIO32
Pin.GPIO33 GPIO33
Pin.GPIO34 GPIO34
Pin.GPIO35 GPIO35
Pin.GPIO36 GPIO36
Pin.GPIO37 GPIO37
Pin.GPIO38 GPIO38
Pin.GPIO39 GPIO39
Pin.GPIO40 GPIO40
Pin.GPIO41 GPIO41
Pin.GPIO42 GPIO42
Pin.GPIO43 GPIO43
Pin.GPIO44 GPIO44
Pin.GPIO45 GPIO45
Pin.GPIO46 GPIO46
Pin.IN Input mode
Pin.OUT Output mode
Pin.PULL_DISABLE Floating mode
Pin.PULL_PU Pull-up mode
Pin.PULL_PD Pull-down mode
Constant Description
Pin.GPIO1 GPIO1
Pin.GPIO2 GPIO2
Pin.GPIO3 GPIO3
Pin.GPIO4 GPIO4
Pin.GPIO5 GPIO5
Pin.GPIO6 GPIO6
Pin.GPIO7 GPIO7
Pin.GPIO8 GPIO8
Pin.GPIO9 GPIO9
Pin.GPIO10 GPIO10
Pin.GPIO11 GPIO11
Pin.IN Input mode
Pin.OUT Output mode
Pin.PULL_DISABLE Floating mode
Pin.PULL_PU Pull-up mode
Pin.PULL_PD Pull-down mode
Constant Description
Pin.GPIO1 GPIO1
Pin.GPIO2 GPIO2
Pin.GPIO3 GPIO3
Pin.GPIO4 GPIO4
Pin.GPIO5 GPIO5
Pin.GPIO6 GPIO6
Pin.GPIO7 GPIO7
Pin.GPIO8 GPIO8
Pin.GPIO9 GPIO9
Pin.GPIO10 GPIO10
Pin.GPIO11 GPIO11
Pin.IN Input mode
Pin.OUT Output mode
Pin.PULL_DISABLE Floating mode
Pin.PULL_PU Pull-up mode
Pin.PULL_PD Pull-down mode
Constant Description
Pin.GPIO1 GPIO1
Pin.GPIO2 GPIO2
Pin.GPIO3 GPIO3
Pin.GPIO4 GPIO4
Pin.GPIO5 GPIO5
Pin.GPIO6 GPIO6
Pin.GPIO7 GPIO7
Pin.GPIO8 GPIO8
Pin.GPIO9 GPIO9
Pin.GPIO10 GPIO10
Pin.GPIO11 GPIO11
Pin.GPIO12 GPIO12
Pin.GPIO13 GPIO13
Pin.GPIO14 GPIO14
Pin.GPIO15 GPIO15
Pin.GPIO16 GPIO16
Pin.GPIO17 GPIO17
Pin.GPIO18 GPIO18
Pin.GPIO19 GPIO19
Pin.GPIO20 GPIO20
Pin.GPIO21 GPIO21
Pin.GPIO22 GPIO22
Pin.GPIO23 GPIO23
Pin.GPIO24 GPIO24
Pin.GPIO25 GPIO25
Pin.GPIO26 GPIO26
Pin.GPIO27 GPIO27
Pin.GPIO28 GPIO28
Pin.GPIO29 GPIO29
Pin.GPIO30 GPIO30
Pin.GPIO31 GPIO31
Pin.GPIO32 GPIO32
Pin.GPIO33 GPIO33
Pin.GPIO34 GPIO34
Pin.GPIO35 GPIO35
Pin.GPIO36 GPIO36
Pin.GPIO37 GPIO37
Pin.GPIO38 GPIO38
Pin.GPIO39 GPIO39
Pin.GPIO40 GPIO40
Pin.GPIO41 GPIO41
Pin.IN Input mode
Pin.OUT Output mode
Pin.PULL_DISABLE Floating mode
Pin.PULL_PU Pull-up mode
Pin.PULL_PD Pull-down mode
型号选择: