Maker.io main logo

Drawing on Eink

2021-08-19 | By M5Stack

License: General Public License Arduino

* Thanks for the source code and project information provided by @Claxvii

 

Story
 

Just a day one small project I decided to post since there isn't much stuff about the m5paper. A slow drawing app you can load through UiFlow (https://flow.m5stack.com/) and you can erase what you drew by touching the very top of the screen.

 
 
Code
 
DrawingAlpha Python
 
This code is meant to be used with UiFlow. I know some people might prefer the visual scratch like code on UiFlow and others may go for the Arduino IDE if they are going to code it anyway, but I found this to be the fastest way to try out this new toy on day one.
Copy Code
from m5stack import *
from m5ui import *
from uiflow import *
from m5stack import touch

setScreenColor(15)


TouchCordx = None
TouchCordy = None

title0 = M5Title(title="Title", x=3, fgcolor=15, bgcolor=0)


# Describe this function...
def SetTouchCordenate():
global TouchCordx
global TouchCordy
TouchCordx, TouchCordy, s, status = touch.read()



setScreenColor(15)
lcd.show()
while True:
if touch.status():
SetTouchCordenate()
if (TouchCordy < 80.0):
lcd.clear()
lcd.rect (0,0,2000,2000,15,15)
else:
lcd.circle(TouchCordx, TouchCordy, 20, 8, 8)
lcd.partial_show(TouchCordx-20, TouchCordy-20, 40, 40)
else:
pass
製造商零件編號 K049-B
M5PAPER ESP32 EINK DEV KIT V1.1
M5Stack Technology Co., Ltd.
Add all DigiKey Parts to Cart
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.