Monochron - Change Size of Dali Clock

For RTC breakouts, etc., use the Other Products from Adafruit forum

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
edc1591
 
Posts: 40
Joined: Sat Jul 14, 2012 11:12 am

Monochron - Change Size of Dali Clock

Post by edc1591 »

I'm having some trouble editing the dali clock firmware for the monochron clock.

I'm trying to make the digits smaller so that I can display the date below it. I tried changing DIGIT_WIDTH and DIGIT_HEIGHT in ratt.h, but that caused the LCD to just flash random garbage and the buzzer kept keeping.

What am I doing wrong?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Monochron - Change Size of Dali Clock

Post by adafruit_support_rick »

The digits are stored as bitmap images (look in the folder 'digits'). Each image is 28X64 pixels, and the values of DIGIT_WIDTH and DIGIT_HEIGHT tell the firmware the size of these bitmaps. If you change the constants, then the digit images won't be unpacked and displayed correctly.

If you want to make the digits smaller, then you will have to edit the digit image .bmp files (and change DIGIT_WIDTH and DIGIT_HEIGHT to match)

edc1591
 
Posts: 40
Joined: Sat Jul 14, 2012 11:12 am

Re: Monochron - Change Size of Dali Clock

Post by edc1591 »

I just tried resizing all of the bitmaps and changed those two variables to correspond, but I'm still having the same problem.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Monochron - Change Size of Dali Clock

Post by adafruit_support_rick »

I know nothing about this code, but I've got one guess left. After that, you'll probably have to contact the author.

In file anim.c, there's a hardcoded 64 for the digit height in a call to blitsegs_rom:

Code: Select all

void drawdigit(uint8_t x, uint8_t y, uint8_t d, uint8_t inverted) {
  blitsegs_rom(x, y, zero_p+d*DIGIT_HEIGHT*4, 64, inverted);
}
Try changing the 64 to DIGIT_HEIGHT :

Code: Select all

void drawdigit(uint8_t x, uint8_t y, uint8_t d, uint8_t inverted) {
  blitsegs_rom(x, y, zero_p+d*DIGIT_HEIGHT*4, DIGIT_HEIGHT, inverted);
}

edc1591
 
Posts: 40
Joined: Sat Jul 14, 2012 11:12 am

Re: Monochron - Change Size of Dali Clock

Post by edc1591 »

Nope, same problem. Here's a picture of what it looks like. It shows this and constantly flickers:
photo.JPG
photo.JPG (865.59 KiB) Viewed 2203 times

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Monochron - Change Size of Dali Clock

Post by adafruit_support_rick »

XDaliChron is at least a couple of levels of modification away from the adafruit original. If you can't manage to figure it out, you'll have to try to track down the author. Here's the readme, if you haven't already got it.
Attachments
readme.txt
(1.82 KiB) Downloaded 204 times

edc1591
 
Posts: 40
Joined: Sat Jul 14, 2012 11:12 am

Re: Monochron - Change Size of Dali Clock

Post by edc1591 »

That's the readme for MultiChron. AFAIK XDaliChron was written by adafruit.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Monochron - Change Size of Dali Clock

Post by adafruit_support_rick »

Could be. This is from before my time. The readme make it look like BANNED and Dataman made the mods.
Maybe you need to run the python script to re-segment the BMPs?

edc1591
 
Posts: 40
Joined: Sat Jul 14, 2012 11:12 am

Re: Monochron - Change Size of Dali Clock

Post by edc1591 »

All that does is spit out a bunch of numbers. Any idea what they mean?

Code: Select all

Downloaded image: BMP (24, 54) RGB
0, 5, 0, 6,
0, 4, 0, 5,
0, 3, 0, 4,
0, 2, 0, 3,
0, 1, 0, 2,
0, 1, 0, 2,
0, 1, 0, 2,
0, 0, 0, 1,
0, 0, 0, 1,
0, 0, 0, 1,
0, 0, 0, 1,
0, 1, 0, 2,
0, 0, 0, 1,
0, 0, 0, 1,
0, 0, 0, 1,
0, 0, 0, 1,
0, 0, 0, 1,
0, 0, 0, 2,
0, 0, 0, 2,
0, 0, 0, 2,
0, 0, 0, 2,
0, 0, 0, 2,
0, 0, 0, 2,
0, 0, 0, 2,
0, 0, 0, 2,
0, 0, 0, 1,
0, 0, 0, 2,
0, 5, 0, 6,
0, 0, 0, 2,
0, 0, 0, 2,
0, 0, 0, 2,
0, 0, 0, 2,
0, 0, 0, 2,
0, 0, 0, 2,
0, 0, 0, 2,
0, 0, 0, 2,
0, 0, 0, 2,
0, 0, 0, 1,
0, 0, 0, 1,
0, 0, 0, 1,
0, 0, 0, 1,
0, 0, 0, 1,
0, 1, 0, 2,
0, 0, 0, 1,
0, 0, 0, 1,
0, 0, 0, 1,
0, 0, 0, 1,
0, 1, 0, 2,
0, 1, 0, 2,
0, 1, 0, 2,
0, 2, 0, 3,
0, 3, 0, 4,
0, 4, 0, 5,
0, 5, 0, 6,

User avatar
adafruit_support_bill
 
Posts: 88142
Joined: Sat Feb 07, 2009 10:11 am

Re: Monochron - Change Size of Dali Clock

Post by adafruit_support_bill »

From the photo, it looks like you still are using full-size bitmaps for the digits, but you are indexing into the bitmap memory as if you had resized them.

Look at the zero: it draws full-size, but is truncated at the bottom. Then look at the 1: it gets the bottom chunk of the zero because your code thinks that is where the 1 should start.

edc1591
 
Posts: 40
Joined: Sat Jul 14, 2012 11:12 am

Re: Monochron - Change Size of Dali Clock

Post by edc1591 »

I definitely resized the images. But how do the images get from the digits folder into the firmware? Do I have to compile it with some special command?

User avatar
adafruit_support_bill
 
Posts: 88142
Joined: Sat Feb 07, 2009 10:11 am

Re: Monochron - Change Size of Dali Clock

Post by adafruit_support_bill »

I believe you have to run the segmenter code to generate "rle.c" which gets compiled into the hex image.

edc1591
 
Posts: 40
Joined: Sat Jul 14, 2012 11:12 am

Re: Monochron - Change Size of Dali Clock

Post by edc1591 »

I have the same problem when I do that.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Monochron - Change Size of Dali Clock

Post by adafruit_support_rick »

The segmented output you posted earlier doesn't look right. segmented.py appears to generate some sort of runlength encoding of the bitmap. Your output really doesn't look like that. I ran segmenter.py on the original 0.bmp, and got the following (Note that the first row of 0.bmp has black pixels from 12 to 15, and the second row has black pixels from 10 to 17. The fourth row has black pixels from 8 to 11, and again from 16 to 19. You can see how that matches the output of segmenter.py):

Code: Select all

driverblock@ubuntu:~/Documents/BANNED-monochron-62c389d/firmware/digits$ ls
0.bmp  2.bmp  4.bmp  6.bmp  8.bmp  rle-in.c   segmenter.py
1.bmp  3.bmp  5.bmp  7.bmp  9.bmp  seg2rle.c
driverblock@ubuntu:~/Documents/BANNED-monochron-62c389d/firmware/digits$ python segmenter.py 0.bmp
Downloaded image: BMP (28, 64) 1
12, 15, 255, 255,
10, 17, 255, 255,
9, 18, 255, 255,
8, 11, 16, 19,
7, 11, 16, 20,
6, 10, 17, 21,
6, 10, 17, 21,
5, 10, 17, 22,
5, 10, 17, 22,
4, 10, 17, 23,
4, 9, 18, 23,
3, 9, 18, 24,
3, 9, 18, 24,
3, 9, 18, 24,
2, 9, 18, 24,
2, 9, 18, 25,
2, 9, 18, 25,
2, 9, 18, 25,
2, 9, 18, 25,
1, 9, 18, 26,
1, 9, 18, 26,
1, 9, 18, 26,
1, 9, 18, 26,
1, 9, 18, 26,
1, 9, 18, 26,
1, 9, 18, 26,
1, 9, 18, 26,
1, 9, 18, 26,
1, 9, 18, 26,
0, 9, 18, 27,
0, 9, 18, 27,
0, 9, 18, 27,
0, 9, 18, 27,
0, 9, 18, 27,
0, 9, 18, 27,
0, 9, 18, 27,
1, 9, 18, 26,
1, 9, 18, 26,
1, 9, 18, 26,
1, 9, 18, 26,
1, 9, 18, 26,
1, 9, 18, 26,
1, 9, 18, 26,
1, 9, 18, 26,
1, 9, 18, 26,
2, 9, 18, 25,
2, 9, 18, 25,
2, 9, 18, 25,
2, 9, 18, 25,
2, 9, 18, 24,
3, 9, 18, 24,
3, 9, 18, 24,
3, 9, 18, 24,
4, 9, 18, 23,
4, 10, 17, 23,
5, 10, 17, 22,
5, 10, 17, 22,
6, 10, 17, 21,
6, 10, 17, 21,
7, 11, 16, 20,
8, 11, 16, 19,
9, 18, 255, 255,
10, 17, 255, 255,
12, 15, 255, 255,
driverblock@ubuntu:~/Documents/BANNED-monochron-62c389d/firmware/digits$ 

edc1591
 
Posts: 40
Joined: Sat Jul 14, 2012 11:12 am

Re: Monochron - Change Size of Dali Clock

Post by edc1591 »

Here's what mine outputs. Is it possible that I'm using the wrong segmented.py? I got it from adafruit on github.

Code: Select all

Evans-MacBook-Pro:digits evan$ ls
0.bmp		3.bmp		6.bmp		9.bmp
1.bmp		4.bmp		7.bmp		segmenter.py
2.bmp		5.bmp		8.bmp
Evans-MacBook-Pro:digits evan$ python segmenter.py 0.bmp
Downloaded image: BMP (24, 54) RGB
0, 5, 0, 6,
0, 4, 0, 5,
0, 3, 0, 4,
0, 2, 0, 3,
0, 1, 0, 2,
0, 1, 0, 2,
0, 1, 0, 2,
0, 0, 0, 1,
0, 0, 0, 1,
0, 0, 0, 1,
0, 0, 0, 1,
0, 1, 0, 2,
0, 0, 0, 1,
0, 0, 0, 1,
0, 0, 0, 1,
0, 0, 0, 1,
0, 0, 0, 1,
0, 0, 0, 2,
0, 0, 0, 2,
0, 0, 0, 2,
0, 0, 0, 2,
0, 0, 0, 2,
0, 0, 0, 2,
0, 0, 0, 2,
0, 0, 0, 2,
0, 0, 0, 1,
0, 0, 0, 2,
0, 5, 0, 6,
0, 0, 0, 2,
0, 0, 0, 2,
0, 0, 0, 2,
0, 0, 0, 2,
0, 0, 0, 2,
0, 0, 0, 2,
0, 0, 0, 2,
0, 0, 0, 2,
0, 0, 0, 2,
0, 0, 0, 1,
0, 0, 0, 1,
0, 0, 0, 1,
0, 0, 0, 1,
0, 0, 0, 1,
0, 1, 0, 2,
0, 0, 0, 1,
0, 0, 0, 1,
0, 0, 0, 1,
0, 0, 0, 1,
0, 1, 0, 2,
0, 1, 0, 2,
0, 1, 0, 2,
0, 2, 0, 3,
0, 3, 0, 4,
0, 4, 0, 5,
0, 5, 0, 6,

Locked
Please be positive and constructive with your questions and comments.

Return to “Clock Kits (discontinued)”