summaryrefslogtreecommitdiffstatshomepage
path: root/tests/wipy/pin.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/wipy/pin.py')
-rw-r--r--tests/wipy/pin.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/wipy/pin.py b/tests/wipy/pin.py
index 9f2eadb963..22c7c6176c 100644
--- a/tests/wipy/pin.py
+++ b/tests/wipy/pin.py
@@ -1,5 +1,7 @@
-""" This test need a set of pins which can be set as inputs and have no external
- pull up or pull down connected.
+"""
+This test need a set of pins which can be set as inputs and have no external
+pull up or pull down connected.
+GP12 and GP17 must be connected together
"""
from machine import Pin
import os
@@ -14,6 +16,13 @@ elif 'WiPy' in mch:
else:
raise Exception('Board not supported!')
+# test initial value
+p = Pin('GP12', Pin.IN)
+Pin('GP17', Pin.OUT, value=1)
+print(p() == 1)
+Pin('GP17', Pin.OUT, value=0)
+print(p() == 0)
+
def test_noinit():
for p in pin_map:
pin = Pin(p)