NodeMCU Projects: Difference between revisions

Content added Content deleted
Line 92: Line 92:
*Fading an LED
*Fading an LED
<syntaxhighlight lang="python">
<syntaxhighlight lang="python">
led = machine.PWM(machine.Pin(2), freq=1000)
import time, math
import time, math
import machine

led = machine.PWM(machine.Pin(2), freq=1000)

def pulse(l, t):
def pulse(l, t):
for i in range(20):
for i in range(20):