[TFT 2.8" shield] get a pixel's color

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

[TFT 2.8" shield] get a pixel's color

Postby thecheshirecat » Fri Feb 22, 2013 4:45 pm

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
thecheshirecat
 
Posts: 5
Joined: Fri Dec 07, 2012 7:47 am

Re: [TFT 2.8" shield] get a pixel's color

Postby thecheshirecat » Sun Feb 24, 2013 8:07 am

up...
thecheshirecat
 
Posts: 5
Joined: Fri Dec 07, 2012 7:47 am

Re: [TFT 2.8" shield] get a pixel's color

Postby pburgess » Sun Feb 24, 2013 9:43 pm

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);
User avatar
pburgess
 
Posts: 1408
Joined: Sun Oct 26, 2008 1:29 am

Re: [TFT 2.8" shield] get a pixel's color

Postby thecheshirecat » Wed Feb 27, 2013 1:25 pm

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 ?
thecheshirecat
 
Posts: 5
Joined: Fri Dec 07, 2012 7:47 am

Re: [TFT 2.8" shield] get a pixel's color

Postby pburgess » Wed Feb 27, 2013 8:55 pm

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.
User avatar
pburgess
 
Posts: 1408
Joined: Sun Oct 26, 2008 1:29 am


Return to Glowy things (LCD, LED, TFT, EL) purchased at Adafruit

Who is online

Users browsing this forum: ArekKindAcere and 3 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [114]

Raspberry Pi[82]
 
FLORA[24]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[12]
Arduino[60]
 
NETduino[14]
 
BeagleBone[23]
 
Android[6]
 
XBee[10]
More Dev Boards[30]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[39]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[9]


 
Breakout Boards[35]
LCDs & Displays[49]
Components & Parts[70]
Batteries & Power[54]
EL Wire/Tape/Panel[52]
LEDs[112]
 
Wireless[16]
Cables[66]
 
Lasers[6]
Sensors/Parts[147]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[70]
 
iDevices[13]
Tools[71]
 
Wearables[41]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[25]


 
Stickers[41]
 
Skill badges[55]
 
Books[26]
 
Circuit Playground[7]
 
Gift Certificates[4]