9. April 2017

How to edit font for OLED display SD1306

In the previous article, I’ve described how to generate custom font for OLED display like SD1306.

Meanwhile, I’ve discovered that number eight and number zero are hard to distinguish when reading from a distance, because of the dot inside the number zero.

I decided to remove the dot from number zero in order to make the font more readable. But how to do it?

Font generated from Squix’s generator is stored in form of source code. That makes it possible to edit. Just the stream of hexadecimal numbers is not very readable for a human.

Here is a small trick. Open the file in Vim in a terminal window. Search for string 0x00 which represents an area with no pixels. Vim should highlight all the occurences of 0x00. If you can’t see the highlight type command:

:set hlsearch

Start shrinking the window of the terminal and you should see that pattern begins to emerge.

When you hit the correct length of a line you should see the number clearly.

Numbers could be rotated, like number seven:

Change the font rebuild the code and the result looks like this:

23. November 2013

Cppcheck – How to open source code at problematic line in Vim

Cppcheck is useful tool for assesment of C++ code quality. It can diagnose many potential problems.

It’s quite easy to configure Cppcheck to open files at problematic location in your favorite editor.

Here is example how to connect Cppcheck and Vim.

Open Edit – Preferences, select Applications tab, click Add

cppcheck-vim-01

Fill following form.

Name: gvim

Executable (point it to your installation of Vim): C:\Program Files (x86)\Vim\vim74\gvim.exe

Parameters: -f +(line) (file)

Click Ok.

cppcheck-vim-02

Set gvim as default application. Select gvim line and click Set as default.

cppcheck-vim-03

Double click any warning or error message and Vim should open at problematic line.

cppcheck-vim-04

8. May 2013

Vim mode in Cloud9 IDE

Cloud9 IDE is cloud base IDE for NodeJS, Python, Ruby or PHP projects.

The cool thing about this IDE is that code editor has support for Vim mode (it also supports Emacs) :)

vim-cloud9

Go to View, Keyboard Mode and select Vim.

Voila you can use many Vim features, like indentation by >> or many others.

Here is offical video from Cloud9 Youtube channel: