Adafruit_ILI9341 | Library for Adafruit ILI9341 displays
kandi X-RAY | Adafruit_ILI9341 Summary
kandi X-RAY | Adafruit_ILI9341 Summary
This is a library for the Adafruit ILI9341 display products. This library works with the Adafruit 2.8" Touch Shield V2 (SPI). Adafruit 2.4" TFT LCD with Touchscreen Breakout w/MicroSD Socket - ILI9341. 2.8" TFT LCD with Touchscreen Breakout Board w/MicroSD Socket - ILI9341. 2.2" 18-bit color TFT LCD display with microSD card breakout - ILI9340. TFT FeatherWing - 2.4" 320x240 Touchscreen For All Feathers. Check out the links above for our tutorials and wiring diagrams. These displays use SPI to communicate, 4 or 5 pins are required to interface (RST is optional). BMP image-loading examples have been moved to the Adafruit_ImageReader library:
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Adafruit_ILI9341
Adafruit_ILI9341 Key Features
Adafruit_ILI9341 Examples and Code Snippets
Community Discussions
Trending Discussions on Adafruit_ILI9341
QUESTION
I want manage a LCD from my C code doing calls to python. I'm newbie in that. My python app works perfectly with LCD. No problems with libraries that are used in my python code. Python2.7 My problem ocurrs when I call to PyModule_GetDict function. If I added a specific library import into python file, my C program crash. The library is Adafruit_ILI9341, and if I not import it, the C program runs correct.
Is it possible that there are incompatible libraries with Python interpeter? How I can debug this problem?
Thanks a lot!
This is my C code:
...ANSWER
Answered 2017-Nov-16 at 10:08I see at least five problems, with all but two being not checking for NULL
values.
You are not checking the return value of PyImport_Import()
. If there is a problem/exception while importing the lcd
module your code continues as if nothing happened.
Also the return value of PyDict_GetItemString()
isn't really checked against NULL
. PyCallable_Check()
is applied, but it is somewhat redundant because PyObject_CallObject()
already checks if the argument is callable.
Of course you are not checking the return value of PyObject_CallObject()
if it is NULL
.
PyErr_Print()
is potentially called even when there is no error/exception which the documentation clearly states will cause a fatal error.
Finally PyInt_AsLong()
is called with a potentially uninitialized presult
pointer. And given the example code it is definately uninitialized because the Python code contains no initLCD()
so pFunc
is NULL
and presult
never gets assigned a value.
So you better initialize each pointer to NULL
and check each and every return value.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Adafruit_ILI9341
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page