Hi, I am trying to add an external OLED display for my AB01 and I am unable to find a suitable library for it, I am using PlatformIO as my development environment.
I already looked at the previous threads:
unfortunately, this did not help. I also looked at the examples here:
It looks like there are two libraries (SSD1306Spi and SSD1306Wire), which one is correct? I’d like to I2C pins to connect to my AB01.
Here are my issues:
Using SSD1306Spi:
#include "LoRaWan_APP.h"
#include "Arduino.h"
#include <CayenneLPP.h>
#include "HT_SSD1306Spi.h"
#include "images.h"
/* Display related parameter */
SSD1306Spi display(GPIO1, GPIO2, GPIO3, SCK, MOSI, MISO, 6000000); //RST,DC,CS,sck,mosi,miso,frequency
I get the following linking error:
XXXX/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: .pio/build/cubecell_board/src/main.cpp.o: in function `SSD1306Spi::display()':
main.cpp:(.text._ZN10SSD1306Spi7displayEv[_ZN10SSD1306Spi7displayEv]+0x21e): undefined reference to `yield()'
/XXXX/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: main.cpp:(.text._ZN10SSD1306Spi7displayEv[_ZN10SSD1306Spi7displayEv]+0x2ac): undefined reference to `yield()'
collect2: error: ld returned 1 exit status
*** [.pio/build/cubecell_board/firmware.elf] Error 1
Using SSD1306Wire:
In file included from src/main.cpp:4:
XXXX/lib/DISPLAY/src/HT_SSD1306Wire.h: In member function 'virtual bool SSD1306Wire::connect()':
XXXX/lib/DISPLAY/src/HT_SSD1306Wire.h:28:33: error: no matching function for call to 'TwoWire::begin(int&, int&, uint32_t&)'
28 | Wire.begin(_sda,_scl,_freq);
| ^
In file included from XXXX/lib/DISPLAY/src/HT_SSD1306Wire.h:5,
from src/main.cpp:4:
XXXX/packages/framework-arduinoasrmicro650x/cores/asr650x/Wire/Wire.h:85:10: note: candidate: 'bool TwoWire::begin(uint32_t, int8_t)'
85 | bool begin(uint32_t frequency = 100000 , int8_t bus_num = -1); // returns true, if successful init of i2c bus
| ^~~~~
XXXX/packages/framework-arduinoasrmicro650x/cores/asr650x/Wire/Wire.h:85:10: note: candidate expects 2 arguments, 3 provided
Compiling .pio/build/cubecell_board/FrameworkArduino/asr650x/Serial/SoftwareSerial.cpp.o
In file included from src/main.cpp:4:
XXXX/lib/DISPLAY/src/HT_SSD1306Wire.h: In member function 'void SSD1306Wire::initI2cIfNeccesary()':
XXXX/lib/DISPLAY/src/HT_SSD1306Wire.h:263:34: error: no matching function for call to 'TwoWire::begin(int&, int&, uint32_t&)'
263 | Wire.begin(_sda,_scl,_freq);
| ^
In file included from XXXX/lib/DISPLAY/src/HT_SSD1306Wire.h:5,
from src/main.cpp:4:
XXXX/packages/framework-arduinoasrmicro650x/cores/asr650x/Wire/Wire.h:85:10: note: candidate: 'bool TwoWire::begin(uint32_t, int8_t)'
85 | bool begin(uint32_t frequency = 100000 , int8_t bus_num = -1); // returns true, if successful init of i2c bus
| ^~~~~
XXXX/packages/framework-arduinoasrmicro650x/cores/asr650x/Wire/Wire.h:85:10: note: candidate expects 2 arguments, 3 provided
platformio.ini
[env:cubecell_board]
platform = asrmicro650x
board = cubecell_board
framework = arduino
build_flags = -Wl,-Map,output.map
lib_deps =
sabas1080/CayenneLPP@^1.1.0
monitor_speed = 115200
board_build.arduino.lorawan.region = EU868
board_build.arduino.lorawan.class = CLASS_A
board_build.arduino.lorawan.netmode = OTAA
board_build.arduino.lorawan.adr = OFF
board_build.arduino.lorawan.uplinkmode = UNCONFIRMED
board_build.arduino.lorawan.net_reserve = OFF
board_build.arduino.lorawan.rgb = ACTIVE
board_build.arduino.lorawan.debug_level = FREQ_AND_DIO
board_build.arduino.lorawan.at_support = OFF