如何解决尝试在arduino uno wifi上使用rgb矩阵时“未声明SPCR”
我尝试了一些示例程序来使arduino uno wifi上的rgb矩阵正常工作。我觉得自己是个白痴,我无法弄清这一点,而且我用谷歌搜索无济于事。错误和代码如下。问题在于rgbmatrix库引用的是未定义的var。我是否缺少需要导入的另一个库?我对arduino完全陌生,但是我已经使用netduino和粒子光子fwiw进行了开发。
感谢您的帮助。我正在尝试为我的男孩建造一个带有炫酷显示效果的火箭书架,但是如果我不能超过这个目标,它将失去很多炫酷效果:)。
/Users/johnwest/Documents/Arduino/libraries/RGBMatrix/RGBMatrix.cpp: In member function 'void cRGBMatrix::begin(int)':
/Users/johnwest/Documents/Arduino/libraries/RGBMatrix/RGBMatrix.cpp:48:5: error: 'SPCR' was not declared in this scope
SPCR = (1<<SPE)|(1<<MSTR)|(1<<SPR1)|(1<<SPR0); //Enable SPI HW,Master Mode,divide clock by 16 //SPI Bus setup
^~~~
/Users/johnwest/Documents/Arduino/libraries/RGBMatrix/RGBMatrix.cpp:48:5: note: suggested alternative: 'SCL'
SPCR = (1<<SPE)|(1<<MSTR)|(1<<SPR1)|(1<<SPR0); //Enable SPI HW,divide clock by 16 //SPI Bus setup
^~~~
SCL
/Users/johnwest/Documents/Arduino/libraries/RGBMatrix/RGBMatrix.cpp:48:16: error: 'SPE' was not declared in this scope
SPCR = (1<<SPE)|(1<<MSTR)|(1<<SPR1)|(1<<SPR0); //Enable SPI HW,divide clock by 16 //SPI Bus setup
^~~
/Users/johnwest/Documents/Arduino/libraries/RGBMatrix/RGBMatrix.cpp:48:16: note: suggested alternative: 'PE'
SPCR = (1<<SPE)|(1<<MSTR)|(1<<SPR1)|(1<<SPR0); //Enable SPI HW,divide clock by 16 //SPI Bus setup
^~~
PE
/Users/johnwest/Documents/Arduino/libraries/RGBMatrix/RGBMatrix.cpp:48:25: error: 'MSTR' was not declared in this scope
SPCR = (1<<SPE)|(1<<MSTR)|(1<<SPR1)|(1<<SPR0); //Enable SPI HW,divide clock by 16 //SPI Bus setup
^~~~
/Users/johnwest/Documents/Arduino/libraries/RGBMatrix/RGBMatrix.cpp:48:25: note: suggested alternative: 'PSTR'
SPCR = (1<<SPE)|(1<<MSTR)|(1<<SPR1)|(1<<SPR0); //Enable SPI HW,divide clock by 16 //SPI Bus setup
^~~~
PSTR
/Users/johnwest/Documents/Arduino/libraries/RGBMatrix/RGBMatrix.cpp:48:35: error: 'SPR1' was not declared in this scope
SPCR = (1<<SPE)|(1<<MSTR)|(1<<SPR1)|(1<<SPR0); //Enable SPI HW,divide clock by 16 //SPI Bus setup
^~~~
/Users/johnwest/Documents/Arduino/libraries/RGBMatrix/RGBMatrix.cpp:48:35: note: suggested alternative: 'SPI0'
SPCR = (1<<SPE)|(1<<MSTR)|(1<<SPR1)|(1<<SPR0); //Enable SPI HW,divide clock by 16 //SPI Bus setup
^~~~
SPI0
/Users/johnwest/Documents/Arduino/libraries/RGBMatrix/RGBMatrix.cpp:48:45: error: 'SPR0' was not declared in this scope
SPCR = (1<<SPE)|(1<<MSTR)|(1<<SPR1)|(1<<SPR0); //Enable SPI HW,divide clock by 16 //SPI Bus setup
^~~~
/Users/johnwest/Documents/Arduino/libraries/RGBMatrix/RGBMatrix.cpp:48:45: note: suggested alternative: 'SPI0'
SPCR = (1<<SPE)|(1<<MSTR)|(1<<SPR1)|(1<<SPR0); //Enable SPI HW,divide clock by 16 //SPI Bus setup
^~~~
SPI0
/Users/johnwest/Documents/Arduino/libraries/RGBMatrix/RGBMatrix.cpp: In member function 'char cRGBMatrix::spiTransfer(char)':
/Users/johnwest/Documents/Arduino/libraries/RGBMatrix/RGBMatrix.cpp:78:5: error: 'SPDR' was not declared in this scope
SPDR = value; // Start the transmission
^~~~
/Users/johnwest/Documents/Arduino/libraries/RGBMatrix/RGBMatrix.cpp:78:5: note: suggested alternative: 'SDA'
SPDR = value; // Start the transmission
^~~~
SDA
/Users/johnwest/Documents/Arduino/libraries/RGBMatrix/RGBMatrix.cpp:79:14: error: 'SPSR' was not declared in this scope
while (!(SPSR & (1<<SPIF))) // Wait for the end of the transmission
^~~~
/Users/johnwest/Documents/Arduino/libraries/RGBMatrix/RGBMatrix.cpp:79:14: note: suggested alternative: 'SS'
while (!(SPSR & (1<<SPIF))) // Wait for the end of the transmission
^~~~
SS
/Users/johnwest/Documents/Arduino/libraries/RGBMatrix/RGBMatrix.cpp:79:25: error: 'SPIF' was not declared in this scope
while (!(SPSR & (1<<SPIF))) // Wait for the end of the transmission
^~~~
/Users/johnwest/Documents/Arduino/libraries/RGBMatrix/RGBMatrix.cpp:79:25: note: suggested alternative: 'SPI0'
while (!(SPSR & (1<<SPIF))) // Wait for the end of the transmission
^~~~
SPI0
exit status 1
Error compiling for board Arduino Uno WiFi Rev2.
^~~
#include <SPI.h>
#include <RGB.h>
#include <RGBMatrix.h>
void setup() {
// put your setup code here,to run once:
}
void loop() {
// put your main code here,to run repeatedly:
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。