Skip to content

Instantly share code, notes, and snippets.

@anotherjesse
Created January 25, 2020 21:33
Show Gist options
  • Select an option

  • Save anotherjesse/2628c1ba6ff7def8ba8cfdb79c060f0d to your computer and use it in GitHub Desktop.

Select an option

Save anotherjesse/2628c1ba6ff7def8ba8cfdb79c060f0d to your computer and use it in GitHub Desktop.
Pin(2, Pin.OUT).value(0) # value(1)
turns on and off the built in blue LED on the esp8266 nodemcu amica
@anotherjesse
Copy link
Copy Markdown
Author

import machine
machine.Pin(2, machine.Pin.OUT).value(0)
machine.Pin(2, machine.Pin.OUT).value(1)

@anotherjesse
Copy link
Copy Markdown
Author

anotherjesse commented Jan 26, 2020

def wag(delay, a, b):                                                                                               
    p.duty(a)                                                                                                       
    time.sleep_ms(delay)                                                                                            
    p.duty(b)                                                                                                       
    time.sleep_ms(delay)                                                                                            

@anotherjesse
Copy link
Copy Markdown
Author

while True: wag(600, 40, 115)

@anotherjesse
Copy link
Copy Markdown
Author

p = machine.PWM(machine.Pin(2), freq=77)

@anotherjesse
Copy link
Copy Markdown
Author

D4 is PWM, Pin 2

@anotherjesse
Copy link
Copy Markdown
Author

maple PWM7 = turtle tail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment