Community
cancel
Showing results for 
Search instead for 
Did you mean: 
FAzli
Beginner
1,800 Views

how to use TFT LCD ili9341 library in intel studion IOT edison?

hello, i have TFT LCD ili9341 https://www.adafruit.com/product/1770 .

the problem is i do not know how to add TFT LCD library in the intel studio iot ??? and how to use the library on coding????.

before this, i coding the tft lcd on the arduino and its work fine. i can coding the graphic and touchscreen on the lcd. when i started to use intel edison. its really complicated. someone please help me.

for Arduino:

# include "Adafruit_GFX.h"

# include "Adafruit_ILI9341.h"

# include "TouchScreen.h"

can i use same coding in Arduino for intel system studio IOT??

0 Kudos
8 Replies
idata
Community Manager
127 Views

Hi Fawwaz,

 

 

Thank you for contacting us.

 

 

I think that it is not possible to use those libraries, you can try to add them, but I can't assure you that they will work ( http://stackoverflow.com/questions/29051576/how-do-i-add-arduino-libraries-to-eclipse-project).

 

 

Personally, I recommend you to use the UPM library, it has a source file for the TFT LCD ili9341 that you can use: https://github.com/intel-iot-devkit/upm/tree/master/src/ili9341. If you want to integrate the UPM on Intel System Studio you can follow this guide: https://software.intel.com/en-us/working-with-sensors-in-intel-system-studio-iot-edition.

 

 

I hope you find this information useful.

 

 

Have a nice day.

 

 

Regards,

 

Leonardo R.
FAzli
Beginner
127 Views

Hi Leonardo R., thank you for this information, i have try using UPM library for TFT LCD ili9341.

and i use this example code for test graphic as below:

# include

# include

int main() {

//! [Interesting]

// Pins (Edison)

// CS_LCD GP44 (MRAA 31)

// CS_SD GP43 (MRAA 38) unused

// DC GP12 (MRAA 20)

// RESEST GP13 (MRAA 14)

upm::ILI9341 * lcd = new upm::ILI9341(31, 38, 20, 14);

// Fill the screen with a solid color

lcd->fillScreen(lcd->color565(0, 40, 16));

// Draw some shapes

lcd->drawFastVLine(10, 10, 100, ILI9341_RED);

lcd->drawFastHLine(20, 10, 50, ILI9341_CYAN);

lcd->drawLine(160, 30, 200, 60, ILI9341_GREEN);

lcd->fillRect(20, 30, 75, 60, ILI9341_ORANGE);

lcd->drawCircle(70, 50, 20, ILI9341_PURPLE);

lcd->fillCircle(120, 50, 20, ILI9341_PURPLE);

lcd->drawTriangle(50, 100, 10, 140, 90, 140, ILI9341_YELLOW);

lcd->fillTriangle(150, 100, 110, 140, 190, 140, ILI9341_YELLOW);

lcd->drawRoundRect(20, 150, 50, 30, 10, ILI9341_RED);

lcd->drawRoundRect(130, 150, 50, 30, 10, ILI9341_RED);

lcd->fillRoundRect(75, 150, 50, 30, 10, ILI9341_RED);

// Write some text

lcd->setCursor(0, 200);

lcd->setTextColor(ILI9341_LIGHTGREY);

lcd->setTextWrap(true);

lcd->setTextSize(1);

lcd->print("Text 1\n");

lcd->setTextSize(2);

lcd->print("Text 2\n");

lcd->setTextSize(3);

lcd->print("Text 3\n");

lcd->setTextSize(4);

lcd->print("Text 4\n");

// Test screen rotation

for(int r = 0; r < 4; r++) {

lcd->setRotation(r);

lcd->fillRect(0, 0, 5, 5, ILI9341_WHITE);

sleep(1);

}

// Invert colors, wait, then revert back

lcd->invertDisplay(true);

sleep(2);

lcd->invertDisplay(false);

// Don't forget to free up that memory!

delete lcd;

//! [Interesting]

return 0;

}

so, i run the code on intel studio iot, and the lcd didnt show any graphic. its just a white blank screen.

is it my connection from lcd to intel edison correct? i using SPI connection..

TFT CLK -> GP40 (MRAA37),pin13

TFT MISO -> GP42 (MRAA50),pin12

TFT MOSI -> GP43 (MRAA38),pin11

TFT CS -> GP44(MRAA31), pin14(A0)

TFT D/C -> GP12(MRAA20), pin 3

TFT RESET -> GP13(MRAA14), pin 5

this is the result i get after run the code:

idata
Community Manager
127 Views

Hi Fawwaz,

 

 

I think that you are connecting the LCD to the Edison in the right way, but I'm not sure because we don't have that display to test it.

 

 

Regarding your issue, according to the second image, it seems that the library is missing. Did you update the MRAA and UPM libraries on your Edison? If you didn't please use these commands:

 

 

echo "src mraa-upm http://iotdk.intel.com/repos/3.5/intelgalactic/opkg/i586" > /etc/opkg/mraa-upm.conf opkg update opkg install mraa opkg install upm

 

 

I also found this repository with another library that can be helpful for you: https://github.com/KurtE/Adafruit_ILI9341/tree/Intel-Edison, it is from 2014 but it may work.

 

 

Let us know if you still have issues.

 

 

Regards,

 

Leonardo R.
FAzli
Beginner
127 Views

Hi Leonardo R. ,

i already did update the MRAA and UPM libraries , and i found another problem here, i try run a simple blinking LED and its show missing libraries. i cannot synchronize the package and its show the error as below:

i using this step to connect to Edison using SSH. my board is connected like picture above. https://software.intel.com/en-us/connecting-to-intel-edison-board-using-ethernet-over-usb IoT - Connecting to your Intel® Edison board using Ethernet over USB | Intel® Software . its fail to synchronize the package.

after that, i try connecting Edison using serial, and follow this https://software.intel.com/en-us/connecting-your-intel-edison-board-using-wifi IoT - Connecting your Intel Edison board using Wi-Fi* | Intel® Software

1)i get my board's IP address

2)this is my internet IP address and ethernet 2 is RNDIS device

3) and i create the New Project. in this step i not sure which Target IP address to put.

4)got error with the target ip address when creating the new project.

can you identify the problem for me?

idata
Community Manager
127 Views

Hi Fawwaz,

 

 

I'm not sure why this is happening to you, I tried to replicate it but I couldn't. I ran the blinking LED without issues, so I recommend you to follow the next steps:

 

 

1. Flash your Edison with the latest Image, you can follow this guide: https://communities.intel.com/docs/DOC-25154 https://communities.intel.com/docs/DOC-25154

 

 

2. Configure your Edison with the command: configure__edison --setup (Set the password, name and WiFi).

 

 

3. Next step is updating your UPM from the terminal using Putty, not inside ISS. Run the command:

 

echo "src mraa-upm http://iotdk.intel.com/repos/3.5/intelgalactic/opkg/i586" > /etc/opkg/mraa-upm.conf opkg update opkg install mraa  opkg install upm

 

 

4. Create a new project, and connect it to your Edison: https://software.intel.com/en-us/node/594232 (If you want to know the IP Address use the command configure_edison --showWiFiIP).

 

 

5. And finally update the libraries in Intel System Studio: https://software.intel.com/en-us/node/705853.

 

 

Let us know if it works for you, we will be waiting for your response.

 

 

Regards,

 

Leonardo R.
idata
Community Manager
127 Views

Hi Fawwaz,

 

 

Do you have any updates about this?

 

 

Regards,

 

Leonardo R.
FAzli
Beginner
127 Views

hi Leonardo R.

i have found the solution, i reinstall the Intel system studio IoT and use intel Edison Board configuration tool to connect intel Edison to internet. So i able to synchronize the packages for mraa and upm libraries.

thanks for your help

idata
Community Manager
127 Views

Hi Fawwaz,

 

 

That's awesome. Thanks for letting us know.

 

 

Feel free to contact us when you have doubts.

 

 

Have a nice weekend.

 

 

Best Regards,

 

Leonardo R.
Reply