Button =================== .. figure:: /_static/products/ledong-module/static/images/button_b.png :width: 55% :align: center Overview -------------------- Press-type switch digital input module. Pressing outputs a high level, releasing outputs a low level. Technical Specifications ------------------------ Operating voltage: VCC 3.3V -5V Module dimensions: 24*48mm Mounting: 2 plastic building block compatible through-holes Data type: Pressed--1 Released--0 Pin Definition ------------------- ===== ============== Pin Definition ===== ============== GND Ground VCC Power DO Digital output NC Not connected ===== ============== Example Code ------------------- **Graphical code** .. figure:: /_static/products/ledong-module/static/examples/button.png :width: 100% :align: center .. code-block:: python T = None from mpython import * p0 = MPythonPin(0, PinMode.IN) def boolean_P0(): return p0.read_digital() == 1 T = 0 while True: if boolean_P0(): T = T + 1 oled.fill(0) oled.DispChar(str(str('Press count: ') + str((str(T)))), 0, 0, 1) oled.show() .. figure:: /_static/products/ledong-module/static/examples/button_1.png :width: 100% :align: center