I have an Arduino DUE
and just got a Micro OLED
display from SparkFun.
Using their library, when I try to compile I get the error below. Other example code works just fine and I've programmed this thing a million times with my code. So it's clearly in the SparkFun code.
Here is the SparkFun tutorial page with a description of the product:
Here is the library I am using:
https://github.com/sparkfun/Micro_OLED_Breakout/tree/master/Firmware/Arduino/libraries/SFE_MicroOLED
Here is the error I get:
Build options changed, rebuilding all
/Applications/Arduino.app/Contents/Resources/Java/libraries/SFE_MicroOLED/hardware.cpp: In member function 'void MicroOLED::spiSetup()':
/Applications/Arduino.app/Contents/Resources/Java/libraries/SFE_MicroOLED/hardware.cpp:46:10: error: cannot convert 'RwReg* {aka volatile long unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in assignment
ssport = portOutputRegister(digitalPinToPort(csPin));
^
/Applications/Arduino.app/Contents/Resources/Java/libraries/SFE_MicroOLED/hardware.cpp:48:51: error: 'portModeRegister' was not declared in this scope
ssreg = portModeRegister(digitalPinToPort(csPin));
^
/Applications/Arduino.app/Contents/Resources/Java/libraries/SFE_MicroOLED/hardware.cpp: In member function 'void MicroOLED::i2cSetup()':
/Applications/Arduino.app/Contents/Resources/Java/libraries/SFE_MicroOLED/hardware.cpp:84:2: error: 'TWBR' was not declared in this scope
TWBR = ((F_CPU / I2C_FREQ) - 16) / 2;
^
/Applications/Arduino.app/Contents/Resources/Java/libraries/SFE_MicroOLED/hardware.cpp: In member function 'void MicroOLED::parallelSetup()':
/Applications/Arduino.app/Contents/Resources/Java/libraries/SFE_MicroOLED/hardware.cpp:109:10: error: cannot convert 'RwReg* {aka volatile long unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in assignment
ssport = portOutputRegister(digitalPinToPort(csPin));
^
/Applications/Arduino.app/Contents/Resources/Java/libraries/SFE_MicroOLED/hardware.cpp:111:51: error: 'portModeRegister' was not declared in this scope
ssreg = portModeRegister(digitalPinToPort(csPin));
^
/Applications/Arduino.app/Contents/Resources/Java/libraries/SFE_MicroOLED/hardware.cpp:114:10: error: cannot convert 'RwReg* {aka volatile long unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in assignment
wrport = portOutputRegister(digitalPinToPort(wrPin));
^
/Applications/Arduino.app/Contents/Resources/Java/libraries/SFE_MicroOLED/hardware.cpp:119:10: error: cannot convert 'RwReg* {aka volatile long unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in assignment
rdport = portOutputRegister(digitalPinToPort(rdPin));
^
Error compiling.
-
That library is uses some AVR specific methods, that aren't implemented for the ARM processor in the Due.Gerben– Gerben2015年02月18日 12:59:38 +00:00Commented Feb 18, 2015 at 12:59
-
Ah, that makes sense. If you want to put this as an answer I will accept. Thankscbmeeks– cbmeeks2015年02月18日 14:10:27 +00:00Commented Feb 18, 2015 at 14:10
1 Answer 1
That library is uses some AVR specific methods, that aren't implemented for the ARM processor in the Due.
I don't see a real easy way to port those methods.
-
This sucks because the DUE has a ton of RAM, 3.3v native so no converters, and is super fast. Would make an awesome mini-OLED console. :-) And yes, I'm old enough that 96K is a lot of RAM. lolcbmeeks– cbmeeks2015年02月19日 14:56:24 +00:00Commented Feb 19, 2015 at 14:56