Graphics on E-Ink Display Shield

How can I Display graphics on the E-Ink Display Shield for the Arduino and how can I use the gray Levels (which are stated in the data sheet)?
Maybe this is stated in the GT20L… data sheet but I am not able to read chinese papers.
Thanks & best regards,
Edgar

The wiki for the shield demonstrates how to draw shapes, etc. Look in EPAPER.h (in the library linked in the wiki) for the available draw methods. If you purchased the 2.7" e-paper screen, you should read my thread about how to fix a bug with the larger screen size. It is only 5 or so spots down from this one.

If you are trying to draw a bitmap, also see the wiki. It isn’t exactly clear, so I’ll try to clear it up. You have to convert your bitmap to the hex representation of its bytes. The wiki provides a tool to do that. Once you have that, you create a byte array (really, an unsigned char array) and just paste your byte code in. This uses PROGMEM to store this array in flash memory because it is too large for on-board memory in the UNO.

I found the bit map capabilities to be pretty restrictive. I wanted to send a bitmap (generated in C#) across the wire, so I wrote up my own code to take the bitmap bytes and draw them on the screen using drawLine. Note that drawPixel does not seem to work in the loop() function for some reason, but you can do the same thing by drawing a line with 1 pixel length and 1 pixel width. If I have time, I may create a library at some point and post it here. It allows you to generate an image on the PC with much nicer fonts, etc., and send it over to be perfectly displayed.

Check out the wiki here:

http://www.seeedstudio.com/wiki/Small_e-Paper_Shield

Maybe my code below will help. It’s designed to read 33 bytes (= 264 bits = number of pixels horizontally on the 2.7" screen) at a time via the serial interface and request more after each row until it reaches the 176th row of pixels. Each bit in the bytes sent is an on/off for a pixel. 1 means black, 0 means white. I do some binary math to determine if the a pixel should be black and draw only if the bit is set to 1. I have not seen a way to do shades of grey, but I really haven’t tried. As far as I can tell, it’s designed for monochrome graphics. Can you post the exact quote that you are speaking of?

Note that I have not optimized this code. It was quickly slapped together. I will need to put in some more fail-safes in case of interrupted transmissions.

[code]
#include <ePaper.h>
#include <SPI.h>
#include <SD.h>

#include “GT20L16_drive.h”

#define SCREEN_SIZE 270
#define EPD_SIZE EPD_2_7

int count = 0;
int go = 0;
int yaxis = 0;
int bytesOnRow = 0;

int x = 0;
int y = 0;

void setup()
{
EPAPER.begin(EPD_SIZE);
EPAPER.setDirection(DIRNORMAL);
eSD.begin(EPD_SIZE);
GT20L16.begin();
Serial.begin(9600);
EPAPER.display();
}

void loop()
{
while (Serial.available()) {
if(go == 1)
{
byte data = Serial.read();
byte mask = 1;
int bitCount = 0;
for (mask = 00000001; mask > 0; mask <<=1)
{
int xaxis = bitCount;

          xaxis += (bytesOnRow * 8);
            
          if(data & mask)
          {        
              EPAPER.drawLine(xaxis, yaxis, xaxis, yaxis);
          }
          
          bitCount++;
      }
      
      bytesOnRow++;


      if(bytesOnRow == 33)
      {
        yaxis++;
        bytesOnRow = 0;
        go = 0;
        Serial.write(110);
        
        if(yaxis == 176)
        {
          go = 0;
          yaxis = 0;
          bytesOnRow = 0;
          
          EPAPER.display();
          EPAPER.clear_sd();
        }
      }
    }
    else
    {
      int ch = Serial.read();
      
      if(ch == 97)
      {
        go = 1; 
        count = 0;
        yaxis = 0;
        bytesOnRow = 0;
        EPAPER.clear_sd();
      }
      
      if(ch == 110)
      {
        go = 1;
        bytesOnRow = 0;
      }
    }
}

}

/*********************************************************************************************************
END FILE
*********************************************************************************************************/[/code]