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

Added drawBitmap and demos to display bitmaps. #26

Merged
merged 2 commits into from
Mar 26, 2017
Merged

Added drawBitmap and demos to display bitmaps. #26

merged 2 commits into from
Mar 26, 2017

Conversation

marcmerlin
Copy link
Contributor

@marcmerlin marcmerlin commented Mar 23, 2017

This is a followup to
7703b62
from @me-no-dev originally sent to espressif#1

  1. a small cleanup to scrollto that was dropped when he pushed it to you
  2. the missing drawBitmap that uses the newly introduced writePixels you just merged

@PaintYourDragon I see you just improved spitftbitmap further. This should be a good alternative for those who don't have an sdcard and still want to display a bitmap.

Now, for full disclosure this original bitmap display code (only 4 lines as you see) was adapted from Paul's old fork of your lib: https://github.com/PaulStoffregen/ILI9341_t3 he had some good example code that only worked on his chips and I thought it was silly that we didn't have access to this on all other capable chips that ran the same LCD, so I found his extra functions and ported them back to your lib through @me-no-dev 's temporary fork. This PR is the last missing bit.

I have tested this on ESP32 both with hardware SPI and software SPI (software SPI should ensure the code works on other chips too). The pitfall is that the examples I gave chew up a lot of RAM, which is going to be missing on non 32bit platforms with less flash.
That said, I think the example is still useful for people to see how drawBitmap and scrollTo get used, and they can easily substitute and smaller bitmap that fits in their RAM/flash (if using progmem)
If you want to drop my bitmap examples or replace them with a small one, that's understandable.
The current demo I included shows a bitmap converted in 2 different ways, and a full size bitmap that gets scrolled horizontally (there is currently no example of ScrollTo that was just added too)

Example:
image

@ladyada
Copy link
Member

ladyada commented Mar 24, 2017

hiya do you have a software test for this? i can run it on esp32, just some way to test :)
oh wait i see you added it - sry, github didnt make obvious...thx! i will try to test soonly

@marcmerlin
Copy link
Contributor Author

marcmerlin commented Mar 26, 2017

By the way, this missing method then allows for this cool DemoSauce code to work (at least most of it):
https://www.youtube.com/watch?v=OmOlm4Y6Clk
If you are interested, I can feed it to you as a patch after this one, although it's a bit big, and I don't expect it to work on any non 32bit architecture.
If you want to have a peek at the code: https://github.com/marcmerlin/IoTuz/tree/master/examples/DemoSauce

@marcmerlin
Copy link
Contributor Author

@ran6110 I think you are commenting on the wrong pull request. This pull request has not been merged, so it could not possibly have impacted you. I recommend you go back in the git history and find the relevant pull request that you think affects you, you can even just rewind the git commits until things work again, and comment on the relevant pull request. Good luck.

@PaintYourDragon
Copy link
Contributor

Will merge for now to restore some basic functionality. Note that there is no edge clipping; this will work only for well-behaved sketches. I'll work on that. Also, in the future, I recommend that sketches that won't work on Uno have comments to that effect.

@PaintYourDragon PaintYourDragon merged commit 03bb041 into adafruit:master Mar 26, 2017
@marcmerlin
Copy link
Contributor Author

@PaintYourDragon thanks for your comments, understood.

@PaintYourDragon
Copy link
Contributor

Working on the clipping issue. Will be removing the pictureEmbed demo in next commit; can't test, simply doesn't compile on ANY board I have here (M0, WICED, etc.). Recommend a simpler/smaller example with images that fit in 32K or so.

@marcmerlin
Copy link
Contributor Author

@PaintYourDragon the demo has instructions on how to make your own pixmap, it's pretty quick. Do you want to give that a shot, or would you like me to go and generate one for you?

@marcmerlin
Copy link
Contributor Author

Sadly it's hard for me to test this on an uno and I'm not sure if progmem would work for the picture definition, but I think it would. That should give you 20-30KB for the pixmap, right?

@PaintYourDragon
Copy link
Contributor

I put the original comments about image conversion back into the new-and-smaller version of pictureEmbed.ino, calling this done, thanks for helping track this down.

@marcmerlin
Copy link
Contributor Author

@PaintYourDragon thank for the merge again and the fixups (and leaving the how to convert to pixmap comments).
For my own learning: if you are on a low mem platform, isn't it better to have your dragonBitmap defined as PROGMEM?

@marcmerlin
Copy link
Contributor Author

@PaintYourDragon because scrollTo isn't shown/documented anywhere, do you think it's worth adding back to the pixmap display example, or some other example to give people a chance to see how it's used?

@PaintYourDragon
Copy link
Contributor

At some point, yes, but this is not that point. Still dealing with fallout from the big transaction-based change. Once support issues for that quiet down, then would look at demoing other new features.

@me-no-dev
Copy link
Contributor

@PaintYourDragon maybe share some of those issues so we can help?

@marcmerlin
Copy link
Contributor Author

marcmerlin commented Mar 29, 2017

@me-no-dev I had a look too, to see if I could help, and all I found was
#27
where the calling code was apparently at fault.
If there are other issues, please let us know.

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.

4 participants