1

I was writing a program for my SSD1306 oled display from scratch without any third party. I have successfully initialized the display. But I dont know the logic to turn on the pixels for a particular ascii character. I am stuck with the logic to print a character on the display. I am using C for programming. Help needed guys.

Thank you

4
  • 2
    If you don't want to use a library (a laudable ambition when learning) you need to be able to read and understand datasheets. Get reading and understanding.
    – joan
    Jul 13, 2017 at 7:27
  • @joan Thanks for the replay. There isn't any details in datasheet about, how to print a character on the display.
    – Dr.pK
    Jul 13, 2017 at 7:44
  • 2
    That's because you need to draw the character pixel by pixel. Either design your own character set at the pixel level (i.e. choose a grid size and decide which pixels are on for each character) or copy an existing character set.
    – joan
    Jul 13, 2017 at 10:44
  • 2
    I agree with @joan going it alone without libraries is a laudable goal when learning, but it does not mean you can't learn from those other libraries. Have you looked at the adafruit library for this part? Jul 13, 2017 at 15:19

1 Answer 1

0

As the others have mentioned in the comments, you're thinking of your problem from far too high of a level. Being able to call print() in a language like python actually goes through several layers of abstraction before it actually hits the display.

A Broad Look at Character Printing

  1. You call the print() function in your language of choice.
  2. Your print() function makes a system call with your OS
  3. Your OS passes the string you want to print to the display driver.
  4. The display driver converts the the string you have to a pixel by pixel grid for you screen.

Now, since you don't have a display driver, that's essentially what your code needs to do. You'll need to define what something like "A" looks like in the terms of lit up dots on your screen.

This is a difficult process to get right, but it's certainly not impossible. You'll spend a lot of time with your display's datasheet, and you might want to spend some time looking at how existing libraries have solved some of these problems.

1
  • @Jacobm01 Thanks for the replay. I get it. Its hard, but i will give a try.
    – Dr.pK
    Jul 14, 2017 at 7:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.