Skip to content

Instantly share code, notes, and snippets.

@suzukiken
Created April 18, 2018 12:47
Show Gist options
  • Save suzukiken/80cb6e738dbf95c54e2289e9df7e71bf to your computer and use it in GitHub Desktop.
Save suzukiken/80cb6e738dbf95c54e2289e9df7e71bf to your computer and use it in GitHub Desktop.
m5stack vibration motor
str = '''
from machine import Pin
import utime
from m5stack import lcd, buttonA
pinout = Pin(5, Pin.OUT)
def onA():
for i in range(0, 2):
pinout.value(1)
lcd.print('beep')
utime.sleep(0.5)
pinout.value(0)
lcd.clear()
utime.sleep(0.5)
buttonA.wasPressed(onA)
'''
f = open('main.py', 'w')
f.write(str)
f.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment