Claxvii
Published © MIT

Drawing on Eink

There are far too few projects with the m5paper, a device that I am loving to play with. That is why I am posting this first day project.

BeginnerProtip30 minutes3,615
Drawing on Eink

Things used in this project

Hardware components

M5Stack M5PAPER
×1

Story

Read more

Code

DrawingAlpha

Python
This code is meant to be used with UiFlow. I know some people might prefer the visual scratch like code on ui flow and others may go for the Arduino IDE if they are gonna code it anyway, but i found this to be the fastest way to try out this new toy on day one.
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

Credits

Claxvii

Claxvii

1 project • 1 follower

Comments