我使用的是带有wemos的led矩阵屏蔽(http://www.wemos.cc/Products/oled_shield.html)。我使用的是Arduino IDE。示例可以完美地工作(https://github.com/wemos/D1_mini_Examples/tree/master/04.Shields/OLED_Shield/Use_SparkFun_Library)
但是当我尝试打印文本时,屏幕仍然是空的。以下是我的代码
#include <Wire.h>
#include <SFE_MicroOLED.h> // Include the SFE_MicroOLED library
#define PIN_RESET 255
#define DC_JUMPER 0
MicroOLED oled(PIN_RESET, DC_JUMPER);
void setup()
{
oled.begin();
oled.clear(ALL);
oled.clear(PAGE);
oled.display();
oled.setFontType(0);
oled.setCursor(0, 0);
oled.print("Hello, world");
oled.display();
}
void loop()
{
}有什么想法吗?
发布于 2016-04-23 03:48:56
我解决了这个问题。我修改了SFE_MicroOLED库。字体加载到程序内存中(通过PROGMEM指令)。这会使代码在wemos上失败。我删除了这个库的一个分支上的PROGMEM指令(https://github.com/landru29/SparkFun_Micro_OLED_Arduino_Library)
我只是检查拱门是否为ARDUINO_ESP8266_NODEMCU https://github.com/landru29/SparkFun_Micro_OLED_Arduino_Library/blob/master/src/util/7segment.h#L37 (对于同一文件夹中的所有其他字体文件均为idem)
https://stackoverflow.com/questions/36768562
复制相似问题