351B; Python | 2019-09-04 09:17:00+02 | SLOC 15
1 1
from machine import ADC, Pin␣
2 1
import time␣
3
4
p0 = Pin(32, Pin.OUT)␣
5
p0.value(1)␣
6
7
estado = False␣
8
9
p1 = Pin(36, Pin.IN, Pin.PULL_UP)␣
10
11
12
while True:␣
13
14 1
    if(p1.value()):␣
15 1
        if(estado):␣
16
            estado = 0␣
17
        else:␣
18
            estado = 1␣
19 1
␣␣␣␣␣␣␣␣␣␣␣␣␣
20
        p0.value(estado)␣
21
        print(estado)␣
22 1
        time.sleep_ms(200)␣