eddiewwm 发表于 2017-10-23 13:00:42

ALPHA 8F328P-U 如何驅動SPI I液晶屏模块TFT ILI9341

ALPHA 8F328P-U 如何驅動 2.4寸SPI液晶屏模块 240*320 带触摸TFT ILI9341?
https://item.taobao.com/item.htm?spm=a230r.1.14.35.429fe0acZN165p&id=522553639886&ns=1&abbucket=12#detail

弘毅 发表于 2017-10-23 13:04:35

你用Arduino UNO驱动起来。。。用8F328P-U就没问题。。。你先用UNO驱动下试试

eddiewwm 发表于 2017-10-23 15:14:42

但結果出乎預期,用Arduino自帶的庫和範例,在Uno 沒問題,但 8F328P-U 卻不成,初步看到應是8F328P-U的硬件 SPI 的問題。但沒法核實。

===================================================
#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"

// For the Adafruit shield, these are the default.
#define TFT_DC 9
#define TFT_CS 10
// Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
// If using the breakout, change pins as desired
//Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);
.....
.....
===================================================

弘毅 发表于 2017-10-23 17:45:20

用的哪个代码?我去测试下

eddiewwm 发表于 2017-10-23 23:14:48

弘毅 发表于 2017-10-23 17:45
用的哪个代码?我去测试下



===========================================
WARNING: library SPI claims to run on architecture(s) and may be incompatible with your current board which runs on architecture(s).

In file included from C:\Users\WONG\AppData\Local\OcrobotPath\packages\OCROBOT\hardware\avrLGT\0.0.12\variants\lgt8fx8p/pins_arduino.h:36:0,

               from C:\Users\WONG\AppData\Local\OcrobotPath\packages\OCROBOT\hardware\avrLGT\0.0.12\cores\lgt8f/Arduino.h:225,

               from C:\Users\WONG\AppData\Local\Temp\build99a8e03a5a46b6708b78bb5e490659a1.tmp\sketch\graphicstest.ino.cpp:1:

C:\Users\WONG\AppData\Local\OcrobotPath\packages\OCROBOT\hardware\avrLGT\0.0.12\variants\lgt8fx8p/../standard/pins_arduino.h:158:0: warning: "E0" redefined

#define E0 22

^

C:\Users\WONG\AppData\Local\OcrobotPath\packages\OCROBOT\hardware\avrLGT\0.0.12\variants\lgt8fx8p/../standard/pins_arduino.h:112:0: note: this is the location of the previous definition

#define E0 20
^

C:\Users\WONG\AppData\Local\OcrobotPath\packages\OCROBOT\hardware\avrLGT\0.0.12\variants\lgt8fx8p/../standard/pins_arduino.h:159:0: warning: "E2" redefined

#define E2 23

^

C:\Users\WONG\AppData\Local\OcrobotPath\packages\OCROBOT\hardware\avrLGT\0.0.12\variants\lgt8fx8p/../standard/pins_arduino.h:114:0: note: this is the location of the previous definition

#define E2 22

^

C:\Users\WONG\Documents\Arduino\libraries\SAdafruit_ILI9341\examples\graphicstest\graphicstest.ino: In function 'long unsigned int testFillScreen()':

graphicstest:113: error: 'yield' was not declared in this scope

   yield();

         ^

C:\Users\WONG\Documents\Arduino\libraries\SAdafruit_ILI9341\examples\graphicstest\graphicstest.ino: In function 'long unsigned int testLines(uint16_t)':

graphicstest:159: error: 'yield' was not declared in this scope

   yield();

         ^

C:\Users\WONG\Documents\Arduino\libraries\SAdafruit_ILI9341\examples\graphicstest\graphicstest.ino: In function 'long unsigned int testFilledRects(uint16_t, uint16_t)':

graphicstest:255: error: 'yield' was not declared in this scope

   yield();

         ^

C:\Users\WONG\Documents\Arduino\libraries\SAdafruit_ILI9341\examples\graphicstest\graphicstest.ino: In function 'long unsigned int testFilledTriangles()':

graphicstest:327: error: 'yield' was not declared in this scope

   yield();

         ^

C:\Users\WONG\Documents\Arduino\libraries\SAdafruit_ILI9341\examples\graphicstest\graphicstest.ino: In function 'long unsigned int testFilledRoundRects()':

graphicstest:361: error: 'yield' was not declared in this scope

   yield();

         ^

Using library SPI at version 1.0 in folder: C:\Users\WONG\AppData\Local\OcrobotPath\packages\OCROBOT\hardware\avrLGT\0.0.12\libraries\SPI
Using library Adafruit_GFX_Library at version 1.2.2 in folder: C:\Users\WONG\Documents\Arduino\libraries\Adafruit_GFX_Library
Using library SAdafruit_ILI9341 at version 1.0.11 in folder: C:\Users\WONG\Documents\Arduino\libraries\SAdafruit_ILI9341
exit status 1
'yield' was not declared in this scope
==================================================



eddiewwm 发表于 2017-10-24 10:16:39

弘毅 发表于 2017-10-23 17:45
用的哪个代码?我去测试下

是用自帶的 Examples>adafruit ILI9341> graphicstest
页: [1]
查看完整版本: ALPHA 8F328P-U 如何驅動SPI I液晶屏模块TFT ILI9341