Digole UART/I2C/SPI Display Library


#264

Yea it makes sense. I learned something new.

I can place the bit map images anywhere I want them and then place the text where I want it and then only update the text boxes as needed.

I just need to learn how to take the image code and use it properly so I can place it on the screen where I want it.

What does your sketch look like where you taking your bitmap code and having it placed where you want it? I’d love to see it as an example of your crated that.


#265

RWB, the Digole boards have 16KB of flash for user font storage and nothing else. This is pixel-oriented, monochrome type of font storage. However, it could be possible to create fonts that are actually icons or sprites and animate them using multiple sprites. I have not explored this but because the fonts are u8glib compatible, they could be any size.

For color icons and sprites, an SD like what @billprozac is proposing makes the most sense. As I mentioned in another topic, choosatron has a working SD library that works very well. Does anyone have a better library?


#266

I think I know what your saying. I can just create custom images and save them to the memory on LCD’s flash memory. Then to create an animation I can just have 2 or 3 different stored images display quickly to get the desired animation. Sounds easy to do once I know how to store the images to the Digole flash memory and then how to call them up by their ID when needed.

So that micro SD slot on the back of the color LCD is not functional huh? It would be nice if it did work.


#267

RWB, you get the idea. The catch is figuring out how to create a u8glib compatible “font” with the desired graphics. I am looking into it.


#268

Something that just occurred to me is that you can use the fonts to create color separated glyphs. IE. one char is the mask for one color and the next is a different color mask. By drawing the chars over top of each other and changing the font color in between, you could store 256 and 262k color glyphs as fonts. This would also allow you to dynamically color icons and glyphs (fireball mario style). Now to figure out the best way to create those fonts. Any headway on that @peekay123?


#269

@billprozac, it is not so straight forward but here is was I have found so far:

The U8glib font format not only contains the bitmat data but also a lot of glyph information for precise font rendering (mainly used for my other lib m2tklib). Some information available in the fonts are described here: http://code.google.com/p/u8glib/wiki/tstring.
The U8glib font format also tries to crop the bitmap data to save as much ROM as possible. All the glyph metric calculation, the bitmap reduction and the font encoding is done by an external program: http://code.google.com/p/u8glib/source/browse/tools/font/bdf2u8g/bdf2u8g.c. Simply compile the c-file with a unix or windows c-compiler (or send me a PM if you need the executable).

bdf2u8g requires a font in the bdf format: http://en.wikipedia.org/wiki/Glyph_Bitmap_Distribution_Format

On the internet several fonts are available as bdf files, see for example here: http://cgit.freedesktop.org/xorg/font/

But it is also possible to convert truetype fonts (ttf) to bdf: I have used http://sofia.nmsu.edu/~mleisher/Software/otf2bdf/ and http://fontforge.org/. I am sure there are more tools (google has some 100.000 hits for “ttf bdf”).

The catch is to get the “font” file in DBF format which can then be converted to the u8glib format with their bdf2u8g utility. I am looking for other utilities besides fontforge at this point.


#270

@peekay123 Finally got the current sensor + LCD up and running correctly.

Now its time to fancy up the display with icons, animations, and graphs.

@timb How is the update coming along?


#271

RWB, I just got my sensors yesterday. Nice work!

I’m still researching the u8glib font creation stuff but what I have done in the past is create icons and animations using GIMP2 and creating bitmaps (via digole converter) in the code (at least until we figure out how to get PROGMEM working). Since they are monochrome, they don’t take a lot of space. I have picked off some u8glib fonts and uploaded them to my displays since the built-in ones are missing some good mid-sized fonts. I know timb is working on some code for that but if your itching, I can post a little sketch that uploads 3 u8glib fonts to the digole. You can change to fonts to your liking.

What kind of animation did you have in mind?


#272

What sensors did ya get?

What’s PROGMEM going to allow us to do? Store custom fonts on the breakouts flash memory and allow us to call it up with a simple code instead of having to put all that code for the images in our sketch?

Yea I would love to look it over and learn how to upload these custom images crated by the Digole online conversion tool. I could certainly use some more mid sized font options also, the stock ones are too small or large.

I’m not 100% sure yet. Once I learn what I’m doing I’ll just keep playing around till I have something I’m happy with. I’m really excited that I’m learning how to customize these graphic LCD screens, its something I have always wanted to be able to do but figured it was beyond my abilities but it looks like I ended up at the right forum :smile:


#273

RWB, I got the current sensor board you have.

PROGMEM will allow us to store bitmap arrays in external flash saving on the limited internal flash and RAM. As for custom fonts, once you’ve uploaded those to the digole, there is no need to have them in your code.

The upload is very straight forward. Look over the u8glib fonts here. The sketch I have uploads these to the digole: u8blib_font_5x7 , u8g_font_7x13B and u8g_font_04b_03br

The 5x7 is a bit different than the built-in 6, the second is the mid-sized one and the third is small and nice to look at. If you want to point out up to 4 fonts you would like, as long as each is < 4KB in size then I can prep the sketch for you and post it.

Designing graphics is really 'touchy feely" and I often find that something that looks good on paper dosen’t always look good on the display. I added some geometric primitives to the library timb will be posting. One thing you can do is put up a basic analog panel meter (with a needle). I have a simple demo for that. With a little work and imagination, who knows what you can do! :smile:


#274

I found the Digole user guide to be pretty helpful when it comes to the codes that are used to trigger effects on the LCD screens.

http://www.digole.com/images/file/Tech_Data/Digole_Serial_Display_Adapter-Manual.pdf


#275

Sorry guys, I’ve had a stomach bug the last couple of days. Hopefully I can get this pushed out today at some point. :smile:

That reminds me, I need to get in touch with someone and get my Color OLED module replaced!


#276

Oh, and @RWB you mentioned the 1.8" Color OLED wasn’t bright enough? There’s a fix from Digole: http://www.digole.com/forum.php?topicID=5

They also have a new 0.96"x0.96" Color OLED: http://www.digole.com/index.php?productID=882

Gonna order me one of those puppies.


#277

timb, I’m just getting over a nasty sinus infection! Cool stuff on the OLED brigthness and that smaller unit looks interesting, especially since it ships from Canada, where I’m at. :smile:


#278

Okay guys, merging some code into the Digole Library now! I’m testing the new geometry functions out with a Wii Nunchuck that I’m porting a driver for! (The Nunchuck, Motion Plus and Classic Controller all communicate over I2C, you can buy a $2 adapter board on SparkFun or Adafruit so you don’t have to cut the cable up. The plan is to use this as a remote control for the SparkBot I’m building!)


#279

timb, I was testing my digoleGeo library which is built on your initial digole lib and found that the digole println() functions did not seem to CRLF to the next line. Presently, you put Print::println("\x0dTRT"); at the end of each println() function. In the past, I used Print::print("TRT"); and that worked well. Comments?


#280

Hmm, something has gone seriously wrong since I last compiled the library on the WebIDE!

I was getting a lot of warnings before about how some of the stuff was declared, but it still compiled. Now, sheesh!

In file included from DigoleSerialDisp.cpp:9:0:
DigoleSerialDisp.h:15:39: error: expected class-name before '{' token
DigoleSerialDisp.h:142:5: error: 'size_t' does not name a type
DigoleSerialDisp.h:148:5: error: 'size_t' does not name a type
DigoleSerialDisp.h:154:5: error: 'size_t' does not name a type
DigoleSerialDisp.h:160:5: error: 'size_t' does not name a type
DigoleSerialDisp.h:166:5: error: 'size_t' does not name a type
DigoleSerialDisp.h:172:5: error: 'size_t' does not name a type
DigoleSerialDisp.h:178:5: error: 'size_t' does not name a type
DigoleSerialDisp.h:184:5: error: 'size_t' does not name a type
DigoleSerialDisp.h:190:5: error: 'size_t' does not name a type
DigoleSerialDisp.h:196:5: error: 'size_t' does not name a type
DigoleSerialDisp.h:202:5: error: 'size_t' does not name a type
DigoleSerialDisp.h:207:5: error: 'size_t' does not name a type
DigoleSerialDisp.h:212:5: error: 'size_t' does not name a type
DigoleSerialDisp.h:217:5: error: 'size_t' does not name a type
DigoleSerialDisp.h:222:5: error: 'size_t' does not name a type
DigoleSerialDisp.h:227:5: error: 'size_t' does not name a type
DigoleSerialDisp.h:232:5: error: 'size_t' does not name a type
DigoleSerialDisp.h:237:5: error: 'size_t' does not name a type
DigoleSerialDisp.h:242:5: error: 'size_t' does not name a type
DigoleSerialDisp.h:247:5: error: 'size_t' does not name a type
DigoleSerialDisp.h:252:5: error: 'size_t' does not name a type
DigoleSerialDisp.h:269:18: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:269:29: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:277:22: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:277:33: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:277:44: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:293:23: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:293:36: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:300:24: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:306:24: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:311:29: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:316:18: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:331:24: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:331:35: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:336:25: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:340:21: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:345:25: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:356:21: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:356:32: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:356:43: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:356:54: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:356:71: error: 'uint8_t' does not name a type
DigoleSerialDisp.h:356:80: error: ISO C++ forbids declaration of 'bitmap' with no type [-fpermissive]
DigoleSerialDisp.h:357:24: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:357:35: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:357:46: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:357:57: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:357:74: error: 'uint8_t' does not name a type
DigoleSerialDisp.h:357:83: error: ISO C++ forbids declaration of 'bitmap' with no type [-fpermissive]
DigoleSerialDisp.h:358:25: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:358:36: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:358:47: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:358:58: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:358:75: error: 'uint8_t' does not name a type
DigoleSerialDisp.h:358:84: error: ISO C++ forbids declaration of 'bitmap' with no type [-fpermissive]
DigoleSerialDisp.h:359:23: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:359:34: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:359:45: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:364:22: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:365:22: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:366:18: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:366:29: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:366:40: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:366:51: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:367:21: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:367:32: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:367:43: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:367:54: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:368:19: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:368:30: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:368:41: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:369:20: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:369:31: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:369:42: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:369:53: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:370:20: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:370:31: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:370:42: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:371:19: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:371:30: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:371:41: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:371:53: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:372:21: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:372:32: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:373:20: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:373:31: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:373:42: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:374:20: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:374:31: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:374:42: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:380:18: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:382:19: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:385:24: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:386:21: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:387:19: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:387:31: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:387:43: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:387:55: error: 'uint8_t' has not been declared
In file included from DigoleSerialDisp.cpp:9:0:
DigoleSerialDisp.h:389:61: error: 'uint8_t' has not been declared
DigoleSerialDisp.h:392:2: error: 'uint8_t' does not name a type
DigoleSerialDisp.h:393:2: error: 'uint8_t' does not name a type
DigoleSerialDisp.h:394:2: error: 'uint8_t' does not name a type
DigoleSerialDisp.h:395:2: error: 'uint8_t' does not name a type
DigoleSerialDisp.h:396:2: error: 'uint8_t' does not name a type
DigoleSerialDisp.h:397:2: error: 'uint8_t' does not name a type
In file included from DigoleSerialDisp.cpp:9:0:
DigoleSerialDisp.h: In member function 'void DigoleSerialDisp::disableCursor()':
DigoleSerialDisp.h:262:9: error: 'Print' has not been declared
DigoleSerialDisp.h: In member function 'void DigoleSerialDisp::enableCursor()':
DigoleSerialDisp.h:266:9: error: 'Print' has not been declared
DigoleSerialDisp.h: In member function 'void DigoleSerialDisp::drawStr(int, int, const char*)':
DigoleSerialDisp.h:270:9: error: 'Print' has not been declared
DigoleSerialDisp.h:271:16: error: 'write' was not declared in this scope
DigoleSerialDisp.h:273:9: error: 'Print' has not been declared
DigoleSerialDisp.h:274:9: error: 'Print' has not been declared
DigoleSerialDisp.h: In member function 'void DigoleSerialDisp::setPrintPos(int, int, int)':
DigoleSerialDisp.h:279:13: error: 'Print' has not been declared
DigoleSerialDisp.h:280:20: error: 'write' was not declared in this scope
DigoleSerialDisp.h:283:13: error: 'Print' has not been declared
DigoleSerialDisp.h:284:20: error: 'write' was not declared in this scope
DigoleSerialDisp.h: In member function 'void DigoleSerialDisp::clearScreen()':
DigoleSerialDisp.h:290:9: error: 'Print' has not been declared
DigoleSerialDisp.h: In member function 'void DigoleSerialDisp::setLCDColRow(int, int)':
DigoleSerialDisp.h:294:9: error: 'Print' has not been declared
DigoleSerialDisp.h:295:18: error: 'write' was not declared in this scope
DigoleSerialDisp.h:297:9: error: 'Print' has not been declared
DigoleSerialDisp.h: In member function 'void DigoleSerialDisp::setI2CAddress(int)':
DigoleSerialDisp.h:301:9: error: 'Print' has not been declared
DigoleSerialDisp.h:302:18: error: 'write' was not declared in this scope
DigoleSerialDisp.h:303:9: error: '_I2Caddress' was not declared in this scope
DigoleSerialDisp.h: In member function 'void DigoleSerialDisp::displayConfig(int)':
DigoleSerialDisp.h:307:9: error: 'Print' has not been declared
DigoleSerialDisp.h:308:16: error: 'write' was not declared in this scope
DigoleSerialDisp.h: In member function 'void DigoleSerialDisp::displayStartScreen(int)':
DigoleSerialDisp.h:312:9: error: 'Print' has not been declared
DigoleSerialDisp.h:313:16: error: 'write' was not declared in this scope
DigoleSerialDisp.h: In member function 'void DigoleSerialDisp::setMode(int)':
DigoleSerialDisp.h:317:9: error: 'Print' has not been declared
DigoleSerialDisp.h:318:16: error: 'write' was not declared in this scope
DigoleSerialDisp.h: In member function 'void DigoleSerialDisp::setTextPosBack()':
DigoleSerialDisp.h:322:9: error: 'Print' has not been declared
DigoleSerialDisp.h: In member function 'void DigoleSerialDisp::setTextPosOffset(char, char)':
DigoleSerialDisp.h:326:9: error: 'Print' has not been declared
DigoleSerialDisp.h:327:22: error: 'write' was not declared in this scope
DigoleSerialDisp.h: In member function 'void DigoleSerialDisp::setTextPosAbs(int, int)':
DigoleSerialDisp.h:332:9: error: 'Print' has not been declared
DigoleSerialDisp.h:333:16: error: 'write' was not declared in this scope
DigoleSerialDisp.h: In member function 'void DigoleSerialDisp::setLinePattern(int)':
DigoleSerialDisp.h:337:9: error: 'Print' has not been declared
DigoleSerialDisp.h:338:22: error: 'write' was not declared in this scope
DigoleSerialDisp.h: In member function 'void DigoleSerialDisp::setLCDChip(int)':
DigoleSerialDisp.h:341:9: error: 'Print' has not been declared
DigoleSerialDisp.h:342:19: error: 'write' was not declared in this scope
DigoleSerialDisp.h: In member function 'void DigoleSerialDisp::digitalOutput(int)':
DigoleSerialDisp.h:346:10: error: 'Print' has not been declared
DigoleSerialDisp.h:347:17: error: 'write' was not declared in this scope
DigoleSerialDisp.cpp: In member function 'void DigoleSerialDisp::preprint()':
DigoleSerialDisp.cpp:13:5: error: 'Print' has not been declared
DigoleSerialDisp.cpp: At global scope:
DigoleSerialDisp.cpp:17:35: error: variable or field 'drawBitmap' declared void
DigoleSerialDisp.cpp:17:35: error: 'uint8_t' was not declared in this scope
DigoleSerialDisp.cpp:17:46: error: 'uint8_t' was not declared in this scope
DigoleSerialDisp.cpp:17:57: error: 'uint8_t' was not declared in this scope
DigoleSerialDisp.cpp:17:68: error: 'uint8_t' was not declared in this scope
DigoleSerialDisp.cpp:17:79: error: expected primary-expression before 'const'
make: *** [DigoleSerialDisp.o] Error 1

#281

timb, did you forget to put #include “application.h” in there?! :wink:


#282

#include "application.h"

#283

So I got the WiiMote working…


Wii Nunchuck Hooked via WiiChuck Board from SparkFun


joy_x joy_y acc_x acc_y acc_z btn_z btn_c

…but, I can’t get it and the Digole display to function over I2C. Even with my partially implemented I2C Library re-write, it’s not working. I haven’t gotten to the Wire.read stuff yet, so I’m thinking that’s where the problem is.

Question: Has anyone else had trouble running multiple I2C devices with their Digole Display in I2C mode?

I’ll break out the Logic 16 this afternoon and see if I can pinpoint what’s going on.