XBMC "big clock" on AVR

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi folks,

I'm an XBMC (xbox media center) user and I like to keep up with the recent svn builds. Recently, code was added to display a clock over several lines of an LCD display.

The code was originally patched to XBMC by Xtinus. I have PM'd him over at the forums but haven't heard from him yet.

Anyway, I have ported the font to use with AVR. Is there a library already out for this? If not, do you think anyone would find this useful/interesting?

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Not sure if the font has been posted don’t remember it but haven’t looked either. However I’ll bet many Freaks would be very interested, as it looks really cool!
-John

Resistance is futile…… You will be compiled!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I used Peter Fleury's LCD library (available at http://www.jump.to/fleury) and adapted Xtinus' font information from the XBMC svn.

Is this code enough or should I clean it up and put it into a usable library? Sorry for the questions, I'm a bit new to this.

//Store custom character information in program memory
//NOTE: Custom Characters for large number font was written by Xtinus
static const PROGMEM unsigned char BoxChar[] =
// Medium Char
{0x1f, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //   _
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x1f, //         _
 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x1f, //  |_     _
 0x1f, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, //   _      |
 0x1f, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x1f, //  |_     _
 0x1f, 0x1f, 0x03, 0x03, 0x03, 0x03, 0x1f, 0x1f, //  _      _|
 0x1f, 0x1f, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, //   |
 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x1f, 0x1f, //         _|
};

static const PROGMEM unsigned char BigNum[11][2][2] = { { {0x03, 0x06},    // 0
                                                          {0x02, 0x07}, }, // 0
                                                        { {0x06, 0x20},    // 1
                                                          {0x07, 0x01}, }, // 1
                                                        { {0x00, 0x05},    // 2
                                                          {0x04, 0x01}, }, // 2
                                                        { {0x00, 0x05},    // 3
                                                          {0x01, 0x07}, }, // 3
                                                        { {0x02, 0x07},    // 4
                                                          {0x20, 0x06}, }, // 4
                                                        { {0x04, 0x00},    // 5
                                                          {0x01, 0x05}, }, // 5
                                                        { {0x03, 0x00},    // 6
                                                          {0x04, 0x05}, }, // 6
                                                        { {0x00, 0x06},    // 7
                                                          {0x20, 0x06}, }, // 7
                                                        { {0x04, 0x05},    // 8
                                                          {0x02, 0x07}, }, // 8
                                                        { {0x04, 0x05},    // 9
                                                          {0x01, 0x07}, }, // 9
                                                        { {0x20, 0x20},    // clear
                                                          {0x20, 0x20}, }, // clear
};

//End of custom character info

void disp_big_num(unsigned char digit, unsigned char x_pos)
{
  lcd_gotoxy(x_pos,0);                                 //Go to top line at position x-pos
  lcd_putc(pgm_read_byte_near(&BigNum[digit][0][0]));  //Write first custom character
  lcd_putc(pgm_read_byte_near(&BigNum[digit][0][1]));  //Write second custom character
  lcd_gotoxy(x_pos,1);                                 //Go to bottom line at posotion x-pos
  lcd_putc(pgm_read_byte_near(&BigNum[digit][1][0]));  //Write third custom character
  lcd_putc(pgm_read_byte_near(&BigNum[digit][1][1]));  //Write forth custom character
}