Hi everybody,
I managed to use the TFT 2.8" shield for arduino, and I'd like to know how to get a Pixel's color. Is there a solution to do that ?
Thanks in advance,
TheCheshireCat
[TFT 2.8" shield] get a pixel's color
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
-
- Posts: 5
- Joined: Fri Dec 07, 2012 8:47 am
- pburgess
- Posts: 4161
- Joined: Sun Oct 26, 2008 2:29 am
Re: [TFT 2.8" shield] get a pixel's color
There's a pixel read function in the library, but I can't say for certain at the moment whether it actually works...might have possibly been a placeholder. Give it a shot and see if it meets your needs:
Code: Select all
uint16_t color;
color = tft.readPixel(x, y);
-
- Posts: 5
- Joined: Fri Dec 07, 2012 8:47 am
Re: [TFT 2.8" shield] get a pixel's color
Thank you very much for your answer, it looks exactly how i need !
Just another little question : Is the TFT shield's library working with an Arduino Mega ? Can I use the exact same code with a Mega and an Uno ?
Just another little question : Is the TFT shield's library working with an Arduino Mega ? Can I use the exact same code with a Mega and an Uno ?
- pburgess
- Posts: 4161
- Joined: Sun Oct 26, 2008 2:29 am
Re: [TFT 2.8" shield] get a pixel's color
Sure does, but it runs a little faster on the Uno than the Mega. Also, if you're using the BMP examples you'll need to configure the SD library to use "soft" SPI.
Please be positive and constructive with your questions and comments.