极客工坊

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 18127|回复: 5

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

[复制链接]
发表于 2017-10-23 13:00:42 | 显示全部楼层 |阅读模式
ALPHA 8F328P-U 如何驅動 2.4寸SPI液晶屏模块 240*320 带触摸TFT ILI9341?
https://item.taobao.com/item.htm ... ;abbucket=12#detail
回复

使用道具 举报

发表于 2017-10-23 13:04:35 | 显示全部楼层
你用Arduino UNO驱动起来。。。用8F328P-U就没问题。。。你先用UNO驱动下试试
回复 支持 反对

使用道具 举报

 楼主| 发表于 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 | 显示全部楼层
用的哪个代码?我去测试下
回复 支持 反对

使用道具 举报

 楼主| 发表于 2017-10-23 23:14:48 | 显示全部楼层
弘毅 发表于 2017-10-23 17:45
用的哪个代码?我去测试下



===========================================
WARNING: library SPI claims to run on [avr] architecture(s) and may be incompatible with your current board which runs on [avrLGT] 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
==================================================



本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
回复 支持 反对

使用道具 举报

 楼主| 发表于 2017-10-24 10:16:39 | 显示全部楼层
弘毅 发表于 2017-10-23 17:45
用的哪个代码?我去测试下

是用自帶的 Examples>adafruit ILI9341> graphicstest
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则 需要先绑定手机号

Archiver|联系我们|极客工坊

GMT+8, 2024-4-24 04:05 , Processed in 0.058205 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表