Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major Engine Revision #3

Open
wants to merge 58 commits into
base: master
Choose a base branch
from
Open

Conversation

gauravmm
Copy link

Hello!

The underlying engine was rewritten (after three long years) to occupy less memory and to be faster. Details of the changes are in UPGRADE.md.

You have made many awesome changes to the library (like PROGMEM, bicolor matrix support, etc.).

If you are interested in using the updated engine, I can help you with parts of the merging process. Alternatively, you can apply the general changes to the root repository and maintain a bi-color support fork here.

If you need my help, I'll (finally!) be around to provide support.

Regards,
Gaurav

@flavio-fernandes
Copy link
Owner

Cool beans, Gaurav !

Yeah, I'll definitely try it out.
I'll start by trying the merge. I will let you know how it goes, for sure.
Give me a few weeks, tho; I'm buried at work
these days.

On a different subject, have you tried using the HT1632 with an Arduino Due
or Arduino Yun?
I did, and failed miserably. :) For once, they don't do PROGMEM. Also,
there is something about
the 'speed' by which they perform digitWrite makes me think the HT1632
can't keep up.

I have a spare Arduino Due. If you have cycles to make that work, I
wouldn't mind at all sending it your way. :)

Best,

-- flavio

On Mon, Jul 28, 2014 at 11:32 AM, Gaurav Manek [email protected]
wrote:

Hello!

The underlying engine was rewritten (after three long years) to occupy
less memory and to be faster. Details of the changes are in UPGRADE.md.

You have made many awesome changes to the library (like PROGMEM, bicolor
matrix support, etc.).

If you are interested in using the updated engine, I can help you with
parts of the merging process. Alternatively, you can apply the general
changes to the root repository and maintain a bi-color support fork here.

If you need my help, I'll (finally!) be around to provide support.

Regards,

Gaurav

You can merge this Pull Request by running

git pull https://github.com/gauravmm/HT1632-for-Arduino master

Or view, comment on, or merge it at:

#3
Commit Summary

  • Changed structure to meet new standard.
  • Made the pixelsInAByte abstract.
  • Changed all images and fonts to the 8-pixels-per-byte scheme.
  • Changed image engine support.
  • More updates on types.
  • Fixed image pixel order problem.
  • Font rendering complete!
  • Added community font, updated image and font conversion utility.
  • Added 8x4 community font, wrote new testing example.
  • Added new font_8x4, new tool to generate FONT_NAME_END matrices.
  • Fixed U character
  • Reordered and renamed examples.
  • Fix heart image.
  • Updated README and UPGRADE
  • Added support for multi-bytes-per-column font.
  • Added ifndef preprocessor instructions.
  • Extended examples, fixed references to getTestWidth
  • README update.
  • Merge branch 'rewrite', ready for v2 release.
  • Minor documentation changes.

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#3.

@hacking-robot
Copy link

awesome! I had left my project because of huge amount of memory used when
coupled with other librairies as well

2014-07-28 19:21 GMT+02:00 flavio-fernandes [email protected]:

Cool beans, Gaurav !

Yeah, I'll definitely try it out.
I'll start by trying the merge. I will let you know how it goes, for sure.
Give me a few weeks, tho; I'm buried at work
these days.

On a different subject, have you tried using the HT1632 with an Arduino
Due
or Arduino Yun?
I did, and failed miserably. :) For once, they don't do PROGMEM. Also,
there is something about
the 'speed' by which they perform digitWrite makes me think the HT1632
can't keep up.

I have a spare Arduino Due. If you have cycles to make that work, I
wouldn't mind at all sending it your way. :)

Best,

-- flavio

On Mon, Jul 28, 2014 at 11:32 AM, Gaurav Manek [email protected]
wrote:

Hello!

The underlying engine was rewritten (after three long years) to occupy
less memory and to be faster. Details of the changes are in UPGRADE.md.

You have made many awesome changes to the library (like PROGMEM, bicolor
matrix support, etc.).

If you are interested in using the updated engine, I can help you with
parts of the merging process. Alternatively, you can apply the general
changes to the root repository and maintain a bi-color support fork
here.

If you need my help, I'll (finally!) be around to provide support.

Regards,

Gaurav

You can merge this Pull Request by running

git pull https://github.com/gauravmm/HT1632-for-Arduino master

Or view, comment on, or merge it at:

#3
Commit Summary

  • Changed structure to meet new standard.
  • Made the pixelsInAByte abstract.
  • Changed all images and fonts to the 8-pixels-per-byte scheme.
  • Changed image engine support.
  • More updates on types.
  • Fixed image pixel order problem.
  • Font rendering complete!
  • Added community font, updated image and font conversion utility.
  • Added 8x4 community font, wrote new testing example.
  • Added new font_8x4, new tool to generate FONT_NAME_END matrices.
  • Fixed U character
  • Reordered and renamed examples.
  • Fix heart image.
  • Updated README and UPGRADE
  • Added support for multi-bytes-per-column font.
  • Added ifndef preprocessor instructions.
  • Extended examples, fixed references to getTestWidth
  • README update.
  • Merge branch 'rewrite', ready for v2 release.
  • Minor documentation changes.

File Changes

(701)

(67)

(38)

(26)

(26)

(25)

(25)

  • A

Arduino/HT1632/examples/HT1632_Text_From_Serial/HT1632_Text_From_Serial.ino
<
https://github.com/flavio-fernandes/HT1632-for-Arduino/pull/3/files#diff-7>

(21)

(163)

(92)

(50)

(99)

(94)

(42)

(165)

(118)

(68)

Patch Links:


Reply to this email directly or view it on GitHub
#3.


Reply to this email directly or view it on GitHub
#3 (comment)
.

@flavio-fernandes
Copy link
Owner

Ouch... I took a stab at it and... this merge is going to be very non-trivial! 🎱
I gotta confess that things are working so well right now -- using Mega2560 with Ether shield
and progmem, that I'm a little lazy to merge. 🍅

David: have you tried my latest set of changes? With that, I've converted all the
fonts and images to use PROGMEM, so it will take a lot less memory than it used to.

Gaurav: My biggest challenge is to merge this commit (below) as well as the PROGMEM
changes done by bskrt (gauravmm#14)
Any ideas/help on that are very welcome. :)

main trouble commit:
3725366

progmem commit:
f03d581

@gauravmm
Copy link
Author

I'll take a look at it. Give me a few hours?

Update: PROGMEM support added. Thanks to bskrt, that was easy.

I don't have a 2416 board, can you explain the memory/addressing layout? More specifically, I don't understand how many HT1632C chips control a single 2416 display, what part of the output each chip controls and the various constants defined here.

I would also like some feedback on an idea:
Right now, the memory buffers are allocated and managed internally, so you just have to set a target with drawTarget(BUFFER_BOARD(1)) and call render() to display it.

Would you prefer a system that allowed you to allocate buffers (perhaps via char* mybuffer = HT1632.allocate()), and then pass it to the drawTarget(mybuffer)?

This would reduce memory requirements - right now a single bi-color 2416 display unit requires (24*16/8)*3 = 144 bytes of memory in buffer space. The final version would only use (24*16/8)*1 = 48 or (24*16/8)*2 = 96 bytes, depending on the information shown.

The trade-off would be that memory management would now become the responsibility of the user. Also, more work for us.

Is it worth it?

@flavio-fernandes
Copy link
Owner

Take your time, Gaurav!

Is it worth it?

Hmm... in name of simpler API, my gut tells me: no, prob not worth it. :) If you look at the newer gen Arduinos (due/yun) there is actually much
more memory. So, as the price of these guys decreases, I gotta beleive that the simple API for user is more important, second to speed. Just my humble opinion, tho!

I think that -- for longevity sake -- it would be interesting in getting the library to work on Due and Yun;
those are the the direction Arduinos are taking these days.

You can get more info on the way ht1632 uses the memory (and the way chips are arranged) here:

http://potofjoy.com/arduinoDocs/ht1632_ledMatrix_downloads/

http://potofjoy.com/arduinoDocs/ht1632_ledMatrix_downloads/Controlling%20the%20Sure%20Electronics%203216%20LED%20matrix.pdf

http://potofjoy.com/arduinoDocs/ht1632_ledMatrix_downloads/DE-DP14112_Ver1.1_EN.pdf <-- page 8

You know, I gotta imagine that Sure Electronics would be really happy to have folks like you working on libraries to support their product. I wish we could get the right person in their company to sponsor the effort! (pipe dreamming :))

@gauravmm
Copy link
Author

Okay, the document you linked me to clearly describes the memory layout.

As far as I can tell, the current code doesn't provide sufficient abstraction: we're assuming that the screens are laid out in the same physical order as their logical (or memory) order.

Instead of modifying the library directly, we should add another layer of abstraction over this layer. Essentially, we need a class that wraps a single instance of this class and exposes its own writing functions. I'll attempt to write that instead.

Also, Due/Yun support is a good idea. Unfortunately, I don't have access to development hardware for either right now.

@gauravmm
Copy link
Author

gauravmm commented Sep 7, 2014

You're right, there's something different about the Bicolor boards' initializing process. Trying to figure it out now.

@flavio-fernandes
Copy link
Owner

Yeah, I recall having to do something different than your original code,
but I don't recall what anymore.

I'm sure my forked repo has that init; maybe looking at that can shed some
light.

Cheers,

-- flavio

On Saturday, September 6, 2014, Gaurav Manek [email protected]
wrote:

You're right, there's something different about the Bicolor boards'
initializing process. Trying to figure it out now.


Reply to this email directly or view it on GitHub
#3 (comment)
.

Sent from Gmail Mobile

@gauravmm
Copy link
Author

gauravmm commented Sep 7, 2014

Got it to work: https://www.youtube.com/watch?v=bBW-Ahtw7fc

I need to test it a little more, and I'll push the completed code in a few hours.

@gauravmm
Copy link
Author

gauravmm commented Sep 7, 2014

Alright! Please perform your testing and pull when ready.

Thanks for your help and patience!

@flavio-fernandes
Copy link
Owner

that is so cool Gaurav!

man, you are quick.

thanks,

-- flavio

On Sunday, September 7, 2014, Gaurav Manek [email protected] wrote:

Alright! Please perform your testing and pull when ready.

Thanks for your help and patience!


Reply to this email directly or view it on GitHub
#3 (comment)
.

Sent from Gmail Mobile

flavio-fernandes and others added 22 commits September 7, 2014 20:34
Fix PGM syntax to comply with latest Arduino IDE (rev 1.5.7).
Tested for backwards-compatibility on 1.0.5
Use char instead of byte for text
Use char instead of byte for text
Modified The files To Natively Support my Sure Electronics 24x16 Monochrome Thing
Sure Electronics 24x16 Support
Adds a new 8x5 font that behaves like a 7-high font for 2-line (x16) displays
A popular library installation technique is to download the library via GitHub's Clone or download > Download ZIP and then use the Arduino IDE's Sketch > Include Library > Add .ZIP Library on the downloaded file. This requires the library to be in the root of the repository, not in a subfolder. If the library is not in the root of the repository this installation technique fails:

Specified folder/zip file does not contain a valid library

This is the standard repository structure used in all official Arduino libraries:
https://github.com/arduino-libraries

This move is also required if you wanted to add your library to the Arduino Library Manager index, which provides an even easier installation option.
Move library to root of repository
Each field of keywords.txt is separated by a single true tab. When you use multiple tabs it causes the field to be interpreted as empty. On Arduino IDE 1.6.5 and newer an empty KEYWORD_TOKENTYPE causes the default editor.function.style highlighting  to be used (as with KEYWORD2, KEYWORD3). On Arduino IDE 1.6.4 and older it causes the keyword to not be recognized for any special highlighting.

Reference:
https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification#keywords
Use a single tab field separator in keywords.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants