Created
April 18, 2018 12:47
-
-
Save suzukiken/80cb6e738dbf95c54e2289e9df7e71bf to your computer and use it in GitHub Desktop.
m5stack vibration motor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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