Comments (10)
@konosubakonoakua 您使用的是STM32F0系列吗?
这个 portOutputRegister(digitalPinToPort(pin))函数 返回的是GPIO的ODR寄存器地址。
STM32F0系列的单片机的GPIO的ODR寄存器是16位的,而其他STM32系列是32位的,所以才有这个报错。
建议解决办法:
在Adafruit_SSD1306.h文件里的第45行:
#elif defined(__STM32__)
typedef volatile uint32_t PortReg;
typedef uint16_t PortMask;
#define HAVE_PORTREG
修改为:
#elif defined(__STM32__)
#if defined(__STM32F0__)
typedef volatile uint16_t PortReg;
#else
typedef volatile uint32_t PortReg;
#endif
typedef uint16_t PortMask;
#define HAVE_PORTREG
不建议使用强制转换
from arduino-for-keil.
我用的f1🤣
from arduino-for-keil.
@konosubakonoakua
感谢提交问题,Adafruit_SSD1306库已重新上传,您可以再编译一下试试
from arduino-for-keil.
@konosubakonoakua
感谢提交问题,Adafruit_SSD1306库已重新上传,您可以再编译一下试试
请问为什么编译成功但是就没有图案显示
from arduino-for-keil.
@GavinOUYANG 尝试多初始化几次
from arduino-for-keil.
@GavinOUYANG 尝试多初始化几次
不知道大佬有没有添加号显示器库的历程,试过u8g2也是不行,谢谢了
from arduino-for-keil.
@GavinOUYANG 尝试多初始化几次
就简单显示一个英文就行了,搞了两三天还是不行,谢谢了
from arduino-for-keil.
@GavinOUYANG 库自带的例程就可以用
from arduino-for-keil.
@GavinOUYANG 您用的是I2C屏吗,可以尝试降低I2C速度,在Wire.h文件里有一个#define FULL_SPEED_I2C,把它注释掉。还有检查一下屏幕的I2C地址,是否和库设置的地址匹配。
from arduino-for-keil.
@GavinOUYANG 您用的是I2C屏吗,可以尝试降低I2C速度,在Wire.h文件里有一个#define FULL_SPEED_I2C,把它注释掉。还有检查一下屏幕的I2C地址,是否和库设置的地址匹配。
好的谢谢
from arduino-for-keil.
Related Issues (20)
- [user contribution] Libraries - Tested HOT 3
- sd卡读写问题 HOT 3
- 移植STM32F107出错 HOT 2
- Low Power Mode [Help nedeed] HOT 2
- 请教一下,如何移植到正点原子的F407或F429开发板里去? HOT 4
- 移植库文件报错 HOT 2
- Some ERROR in Print.h..
- STM32SD 移植失败,补了很多路径也不行 HOT 1
- STM32用此包导致芯片锁死 HOT 2
- BMP280
- Keil5不能引用Arduino库中的Class HOT 2
- 编译无法使用C++11 arduino的很多库在头文件中就给成员赋值了 导致出错 这个问题怎么解决 HOT 8
- 调试IIC时,初始化出不来, HOT 1
- 使用F401RC仿真运行,为什么不停的复位? HOT 2
- 按照教程移植,但是导入库失败 HOT 4
- 移植到其他平台问题 HOT 2
- 我在其他地方找不到答案, 为什么不是只编译修改过的文件 HOT 1
- STM32F103RC移植报错 HOT 9
- stm32f103IIC读取mpu9250失败 HOT 1
- 对FastLED库的支持!
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arduino-for-keil.