parameters: (epd, start)
docstring: simple partial update demo - draw random shapes
docstring_summary: simple partial update demo - draw random shapes
docstring_tokens: simple partial update demo - draw random shapes
function: def demo(epd, start):
      """simple partial update demo - draw random shapes"""
  
      # initially set all white background
      image = Image.new('1', epd.size, WHITE)
  
      # prepare for drawing
      draw = ImageDraw.Draw(image)
      width, height = image.size
  
      font = ImageFont.truetype(FONT_FILE, FONT_SIZE)
  
      counter = start & 0xffff
  
      while True:
          draw.rectangle((0, 0, width, height), fill=WHITE, outline=WHITE)
          draw.text((0, 0), '{c:04X}'.format(c=counter), fill=BLACK, font=font)
          counter = (counter + 1) & 0xffff
  
          # display image on the panel
          epd.display(image)
          epd.partial_update()
function_tokens: def demo ( epd , start ) : # initially set all white background image = Image . new ( '1' , epd . size , WHITE ) # prepare for drawing draw = ImageDraw . Draw ( image ) width , height = image . size font = ImageFont . truetype ( FONT_FILE , FONT_SIZE ) counter = start & 0xffff while True : draw . rectangle ( ( 0 , 0 , width , height ) , fill = WHITE , outline = WHITE ) draw . text ( ( 0 , 0 ) , '{c:04X}' . format ( c = counter ) , fill = BLACK , font = font ) counter = ( counter + 1 ) & 0xffff # display image on the panel epd . display ( image ) epd . partial_update ( )