New S1D13700 Beta Library for Arduino

I have been getting a lot of questions about how to implement bitmap fonts and bitmap images using the Arduino. I added some quick functions to the library.

void S1D13700::writeBitmapText(char * text,int x, int y, unsigned int * font)
Bitmap Text With Arduino

The pictures shows the size difference between the hardware font and the new bitmap font. I wrote the function to work only with the included 16 pixel fixed width font (Lucida Console). I didn’t have time to write a proper font converter utility and all that.

void S1D13700::drawBitmap(unsigned char * bmp, int x, int y, int width, int height)

Bitmap Logo With Arduino

Bitmap Logo With Arduino

The bitmap function should work fine with the any LCD bitmap converter. Pixels are encoded left to right, one byte representing 8 bits and each new line starting with a fresh byte (see example bitmap header file). You must specify the correct size or the bitmap will be garbled.

S1D13700 Library for Arduino- Beta

    • tevroc
    • March 9th, 2011

    i get ” avrdude: stk500_cmd(): programmer is out of sync ” after upload. arduino uno. screen is just blank. NS pin is just supposed to be open correct?

      • tevroc
      • March 10th, 2011

      nevermind about that.. it was because i was using a usb hub

    • tevroc
    • March 10th, 2011

    Trying to get the bitmap to work.. cant get anything but garbled nonsense. the example works beautiflly. tried http://www.crystalfontz.com/forum/showthread.php?t=5854 and http://en.radzio.dxp.pl/bitmap_converter/ and tried a bunch of options and so far nothing has worked. I did remember to change the size as well. if you could, please tell us what bitmap converter did you use? thanks!

      • cafeadmin
      • March 22nd, 2011

      I just used my own script. For the next library update, I’m working on a utility that will produce the correct C code.

    • Hugo
    • April 10th, 2011

    Hello
    I fighting to interface my display with arduino Duemilanove like the one in the picture.
    Is it possible to someone provide me the right schematic of the wires.

      • Kyle
      • April 14th, 2011

      I used the pdf included in the non beta library, it is a schematic, but the pin out numbers are the same.

    • Kyle
    • April 14th, 2011

    Hey, I was wondering if the library included a way to display or rather convert an int, and other variable types.

      • cafeadmin
      • April 26th, 2011

      This is included in the standard c library. You can use the sprintf function or the itoa function. Both are covered all over the inet.

    • Hugo007
    • April 28th, 2011

    Hello
    Finally I successful interface my arduino with the display.
    Is there any bitmap converter to convert bmp to the display?
    Like the logo of cafelogic on the example sketch?
    I had tried some converters but just appears scratches on display
    Also I don’t see how the coordinates system on the display are defined
    Any tip?

    • Vadim
    • April 29th, 2011

    Given appendix GLCDtools 1.0.1.8 free has successfully coped with image converting under the given library personally has checked up, on the Internet will find references,

    Россия forever

    • Vadim
    • April 30th, 2011
    • TJ
    • May 18th, 2011

    Do I have to use all D0-D7? I have one of those 20×4 LCD screen, and it just uses D4-D7. If possible, I would like to have this touchscreen be running alongside a rtc. The problem that I’m having is that this touchscreen uses pin 0-12 on the arduino, and the real time clock (DS3234) talks to arduino via SPI, which uses pins 10,11,12,13. If anyone else knows how to make it work, I’m all ears.

    Thanks for reading!

      • cafeadmin
      • May 22nd, 2011

      To the best of my knowledge, only character LCD controller allow a 4-pin parallel connection. For less usage, you can try to find a serial LCD.

      The easiest way to free pins 10-13 is simply to use pins 14-19 (analog pins) for the LCD instead. Alternatively, you can get an Arduino with more pins (Mega).

    • Michele
    • June 1st, 2011

    Hi,
    I’m using a 320×240 LCD with your S1D13700 library for Arduino and everything works fine.
    But I need to free some of the Arduino pin to connect some other stuff. I have a I2C port expander PCF8574 and I would like to modify you library to make Arduino talk to the S1D13700 controller through PCF8574 and I2C bus.
    Can you please give me some suggestion on how to do it?
    It seem to me that the only function to modify is setData… but probably it is not so simple…

    Thanks in advance for your help.

    • Michele
    • June 2nd, 2011

    Michele :
    …I would like to modify you library to make Arduino talk to the S1D13700 controller through PCF8574 and I2C bus….

    Hey, I made it!
    I modified S1D13700.h and .cpp to use a PCF8574 port expander via I2C bus instead of 8 arduino digital pin!
    It is a little bit slow but it works!
    Please contact me if you want me to share the code.

      • cafeadmin
      • June 8th, 2011

      Great job! If you use an SPI expander instead (like the MCP23S17) of I2C, it could solve some of the speed problem.

    • Sanyaade
    • June 3rd, 2011

    There are lots of good discussions here and I am glad to find this website.

    Using PIC instead of Arduino to drive and display LCD graphic will be very nice and I have looking forward for things of this nature.

    My Question is –> Is there a place on the internet where some can find the LCD connection label/pin-out for major or popular graphic LCD like the epson, hitachi, sony, HP, etc..? Please advice!

    As I will like also to be able to use 16″, 17″, 22″ or higher dimension screen.

    Android has been ported to Arduino, see –> http://www.amarino-toolkit.net/ , so the graphic/display driver should not be a problem any more.

    Microchip is also doing the same thing for some of their chip line. See –> http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2919&param=en546070 and also –> http://www.microchip.com/android/ There are lots of discussion on the forum for the PIC32 as well.

    I have used BeagleBoard and SamSung FriendlyArm kit with 22″ and 32″ LCD monitors with no problems. If Arduino is a junior of those MCU then it is doable from it as well and also from some PIC familes with better memory and ported android.

    God blesses!!!

    Best regards,
    Sanyaade

      • cafeadmin
      • June 8th, 2011

      Android has not been ported to Arduino. The link you shared is a resource for developing accessories for Android devices. Since the Arduino is an 8-bit device with limited memory space, it is not suitable for running Linux. If you want to run high resolution screens, you will have to stick to more powerful CPUs, like the ones you mentioned.

      There is also a fundamental connection difference. Simple graphic LCDs like this one can be connected directly yo the pins of the MCU. 16″, 17″ etc displays typically use differential signaling called LVDS. That means you always need external hardware between the screen and the CPU.

    • zoroastre74
    • November 9th, 2011

    Hello all,

    I have stange things with the lcd drawing. I will try to explain it well.

    First, after next 2 days, the screen turns blank.
    Second, boxes, lines are very awefull, and i don’t know why. Idem for the sin waves in the demo sketch.

    I use the glcd with a mega1280, wires on pins throught 22 to 29 (d0 to D7) and rd = 38, wr = 39, a0 = 40, cs = 41, rst = 42. The logo and textbitmap work all well.

    I’m trying to simply draw a box for example, on [x], it draws dotted lines, on [y], it draws double lines with a little space in beetween.

    @+

    Zoroastre.

    • zoroastre74
    • November 11th, 2011

    Yep!

    I resolved the bad draw. It was a forgotten assignation of FIXED_PIN in file S1D13700.h, as i use port A.

    For the blank screen problem, i’ve just disconnect the RST wire coming from the arduino. I’ve to wait 2 more days …

    @+

    Zoroastre.

    • zoroastre74
    • November 12th, 2011

    Hello all,

    Is there an easy way to use (or implement) double layers capabilities of S1D13700, one for bitmaptext, the other for standard graphics ? I think it will be time saving as we do not have to redraw all things anytime.
    It could also be interesting to draw things white on black or black on white easier.

    If anyone have cue to perform these inproving customisations ;)

    @+

    Zoroastre.

    • zoroastre74
    • November 19th, 2011

    Yep!

    There is some more implementation in the sritchie code.
    The URL: https://github.com/sritchie/S1D13700-LCD

    For the Touchscreen, i use the code from adafruit, which works perfect.
    The URL: https://github.com/adafruit/Touch-Screen-Library

    Calibration routine is requested.

    @+

    Zoroastre.

      • Alessio
      • June 22nd, 2015

      How did you connect the DIN, DOUT, CS and DCLOCK touchscreen’s pins in order to use the Touch screen libray correctly?

      I mean that the library has only X+, X-, Y+ and Y- pins has external interface.

      These pins are not available externally for the user.

    • vovpvi
    • January 21st, 2012

    Hello,

    I tried to install the library on the latest Arduino version 1.O. Ik have not connected a board en just using my laptop.
    When I push the button “compile” I get an error message called:
    In file included from example.cpp:46:
    C:\arduino-1.0-windows\libraries\S1D13700/S1D13700.h:45:22: error: WProgram.h: No such file or directory

    Where can I find this file?

      • vovpvi
      • January 23rd, 2012

      I have installad a previous version of the arduino software (rev.22) and now it seems to work.

    • Jeff Erickson
    • February 21st, 2014

    I’m currently developing a product that could use your SID13700 Arduino library, I see in the files that I would need to gain your permission to use them, it would save me the time of re-writing my own version . If you could shoot me an email so we could talk about it I would really appreciate it.Ive already modified the files to enhance its basic functions and I’d be glad to share that with you but the enhancements aren’t anything earthshaking.
    Thanks

    • Ghazan Haider
    • April 25th, 2015

    Thanks for the library, the demo looks great.

    I used it on my LM2088 big LCD with an arduino mega.

    Watch for voltage pump pin on the lcd which takes it much higher than 5v and must be attached at the other end of the potentiometer to connect to contrast adjustment.. you see nothing whether you connect the contrast pin to 5V or GND. It has to go to much higher voltages.

    Also the custom pin settings fails in this library. A hard assumption is used that data0=pin0 and so on in the cpp file. I found that out after I did debug serial outputs of variables. Just hardcode it instead of relying on the library logic.

    The above two took some time but it works perfectly now. Thanks

    Ghazan Haider

  1. No trackbacks yet.