Using Arduino 101 and libraries that work for Uno

I have quite a long code that brings in several libraries that works fine for an Uno, but it pushes the limits of what the board can handle. I want to keep the board to the same size as an Uno, but upgrade the capabilities, so I was thinking either an Arduino 101 or Zero. I was hoping to go with the Arduino 101 as it is cheaper and I do not quite need the power of the Zero.

My problem is that I have tried to "Verify" the code as if it were going on a 101, and it brings up a large variety of error messages that pretty much complain about different libraries that I am trying to include. This code works just fine on the Uno aside from being too much for it. I can only assume that there is something in the library itself that is coded differently that the 101 can't handle. The Zero also does this for some reason. I have tried this with a Mega and it accepts it very happily.

Most of the libraries are for Adafruit items like LCDs, BMP Pressure Sensors, and SD Card. I am not so worried with each individual library unless there is a likely work around to solve each typical problem. I just want to know if this is a common problem that I can expect when using a 101 or a Zero. If so, I will probably just go to a Mega, but I would prefer to use a smaller board if possible without requiring a large change in the code. Below is an example of what the error typically looks like, and there are tons of these that come up:

C:\Program Files (x86)\Arduino\libraries\Adafruit_BMP085_Unified-master\Adafruit_BMP085_U.cpp: In member function 'void Adafruit_BMP085_Unified::getTemperature(float*)':

C:\Program Files (x86)\Arduino\libraries\Adafruit_BMP085_Unified-master\Adafruit_BMP085_U.cpp:332:15: warning: unused variable 'X1' [-Wunused-variable]

int32_t UT, X1, X2, B5; // following ds convention

I just want to know if this is a common problem that I can expect when using a 101 or a Zero.

Yes, alas. Libraries will frequently use chip-specific features, and unless they've been specifically coded to support different families of chips, they may fail to work. Especially on newer boards. (alternatively, libraries CAN be coded to be very compatible (though slower.) This doesn't seem to be that common, alas.)

warning: unused variable 'X1' [-Wunused-variable]

That's not an error; it's only a warning. Probably a result of slightly different compiler versions and/or compile switches...

Okay so is the warning still possibly functional, or is it likely that it still wouldn't work. Below is all the warnings and errors that I get from the code. Most start as just warnings until I get to the LCD. This LCD is actually a different library than I do plan to use down the line.

Would it be less headache to just go with a Mega?

C:\Users\Anthony\Documents\Arduino\Flow_Meter\Flow_Meter.ino: In function 'void setup()':

C:\Users\Anthony\Documents\Arduino\Flow_Meter\Flow_Meter.ino:212:40: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

error("Card failed, or not present");

^

C:\Users\Anthony\Documents\Arduino\Flow_Meter\Flow_Meter.ino: In function 'void loop()':

C:\Users\Anthony\Documents\Arduino\Flow_Meter\Flow_Meter.ino:295:46: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

error("Failed to read from DHT sensor!");

^

C:\Program Files (x86)\Arduino\libraries\Adafruit_BMP085_Unified-master\Adafruit_BMP085_U.cpp: In member function 'void Adafruit_BMP085_Unified::getTemperature(float*)':

C:\Program Files (x86)\Arduino\libraries\Adafruit_BMP085_Unified-master\Adafruit_BMP085_U.cpp:332:15: warning: unused variable 'X1' [-Wunused-variable]

int32_t UT, X1, X2, B5; // following ds convention

^

C:\Program Files (x86)\Arduino\libraries\Adafruit_BMP085_Unified-master\Adafruit_BMP085_U.cpp:332:19: warning: unused variable 'X2' [-Wunused-variable]

int32_t UT, X1, X2, B5; // following ds convention

^

C:\Users\Anthony\AppData\Local\Arduino15\packages\Intel\hardware\arc32\1.0.5\libraries\SD\src\utility\Sd2Card.cpp: In member function 'uint8_t Sd2Card::readData(uint32_t, uint16_t, uint16_t, uint8_t*)':

C:\Users\Anthony\AppData\Local\Arduino15\packages\Intel\hardware\arc32\1.0.5\libraries\SD\src\utility\Sd2Card.cpp:379:12: warning: unused variable 'n' [-Wunused-variable]

uint16_t n;

^

C:\Users\Anthony\AppData\Local\Arduino15\packages\Intel\hardware\arc32\1.0.5\libraries\SD\src\utility\SdFile.cpp: In static member function 'static uint8_t SdFile::make83Name(const char*, uint8_t*)':

C:\Users\Anthony\AppData\Local\Arduino15\packages\Intel\hardware\arc32\1.0.5\libraries\SD\src\utility\SdFile.cpp:261:15: warning: unused variable 'b' [-Wunused-variable]

uint8_t b;

^

C:\Users\Anthony\AppData\Local\Arduino15\packages\Intel\hardware\arc32\1.0.5\libraries\SD\src\utility\SdFile.cpp: In member function 'uint8_t SdFile::rmRfStar()':

C:\Users\Anthony\AppData\Local\Arduino15\packages\Intel\hardware\arc32\1.0.5\libraries\SD\src\utility\SdFile.cpp:907:40: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

if (curPosition_ != (32*(index + 1))) {

^

C:\Program Files (x86)\Arduino\libraries\RTClib-master\RTClib.cpp: In constructor 'DateTime::DateTime(const char*, const char*)':

C:\Program Files (x86)\Arduino\libraries\RTClib-master\RTClib.cpp:136:70: warning: operation on '((DateTime*)this)->DateTime::m' may be undefined [-Wsequence-point]

case 'J': m = date[1] == 'a' ? 1 : m = date[2] == 'n' ? 6 : 7; break;

^

C:\Program Files (x86)\Arduino\libraries\RTClib-master\RTClib.cpp: In constructor 'DateTime::DateTime(const __FlashStringHelper*, const __FlashStringHelper*)':

C:\Program Files (x86)\Arduino\libraries\RTClib-master\RTClib.cpp:161:70: warning: operation on '((DateTime*)this)->DateTime::m' may be undefined [-Wsequence-point]

case 'J': m = buff[1] == 'a' ? 1 : m = buff[2] == 'n' ? 6 : 7; break;

^

C:\Program Files (x86)\Arduino\libraries\NewliquidCrystal\LiquidCrystal_I2C_ByVac.cpp: In constructor 'LiquidCrystal_I2C_ByVac::LiquidCrystal_I2C_ByVac(uint8_t)':

C:\Program Files (x86)\Arduino\libraries\NewliquidCrystal\LiquidCrystal_I2C_ByVac.cpp:41:14: warning: statement has no effect [-Wunused-value]

_polarity == NEGATIVE;

^

In file included from C:\Program Files (x86)\Arduino\libraries\NewliquidCrystal\LiquidCrystal_SR1W.cpp:35:0:

C:\Program Files (x86)\Arduino\libraries\NewliquidCrystal\LiquidCrystal_SR1W.h:157:1: warning: multi-line comment [-Wcomment]

// | | 0.1uF | \

^

In file included from C:\Program Files (x86)\Arduino\libraries\NewliquidCrystal\LiquidCrystal_SR1W.cpp:35:0:

C:\Program Files (x86)\Arduino\libraries\NewliquidCrystal\LiquidCrystal_SR1W.cpp: In member function 'uint8_t LiquidCrystal_SR1W::clearSR()':

C:\Program Files (x86)\Arduino\libraries\NewliquidCrystal\LiquidCrystal_SR1W.cpp:77:24: error: invalid type argument of unary '*' (have 'fio_register {aka unsigned char}')

SR1W_ATOMIC_WRITE_LOW(srRegister, srMask);

^

C:\Program Files (x86)\Arduino\libraries\NewliquidCrystal\LiquidCrystal_SR1W.h:293:79: note: in definition of macro 'SR1W_ATOMIC_WRITE_LOW'

#define SR1W_ATOMIC_WRITE_LOW(reg, mask) ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { *reg &= ~mask; }

^

C:\Program Files (x86)\Arduino\libraries\NewliquidCrystal\LiquidCrystal_SR1W.cpp:86:22: error: invalid type argument of unary '*' (have 'fio_register {aka unsigned char}')

fio_bit reg_val = *srRegister;

^

C:\Program Files (x86)\Arduino\libraries\NewliquidCrystal\LiquidCrystal_SR1W.cpp:95:5: error: invalid type argument of unary '*' (have 'fio_register {aka unsigned char}')

*srRegister = bit_high;

^

C:\Program Files (x86)\Arduino\libraries\NewliquidCrystal\LiquidCrystal_SR1W.cpp:96:5: error: invalid type argument of unary '*' (have 'fio_register {aka unsigned char}')

*srRegister = bit_low;

^

C:\Program Files (x86)\Arduino\libraries\NewliquidCrystal\LiquidCrystal_SR1W.cpp:101:4: error: invalid type argument of unary '*' (have 'fio_register {aka unsigned char}')

*srRegister = bit_high;

^

C:\Program Files (x86)\Arduino\libraries\NewliquidCrystal\LiquidCrystal_SR1W.cpp: In member function 'uint8_t LiquidCrystal_SR1W::loadSR(uint8_t)':

C:\Program Files (x86)\Arduino\libraries\NewliquidCrystal\LiquidCrystal_SR1W.cpp:139:24: error: invalid type argument of unary '*' (have 'fio_register {aka unsigned char}')

fio_bit reg_val = *srRegister;

^

C:\Program Files (x86)\Arduino\libraries\NewliquidCrystal\LiquidCrystal_SR1W.cpp:144:6: error: invalid type argument of unary '*' (have 'fio_register {aka unsigned char}')

*srRegister = bit_low;

^

C:\Program Files (x86)\Arduino\libraries\NewliquidCrystal\LiquidCrystal_SR1W.cpp:145:6: error: invalid type argument of unary '*' (have 'fio_register {aka unsigned char}')

*srRegister = bit_high;

^

In file included from C:\Program Files (x86)\Arduino\libraries\NewliquidCrystal\LiquidCrystal_SR1W.cpp:35:0:

C:\Program Files (x86)\Arduino\libraries\NewliquidCrystal\LiquidCrystal_SR1W.cpp:151:26: error: invalid type argument of unary '*' (have 'fio_register {aka unsigned char}')

SR1W_ATOMIC_WRITE_LOW(srRegister, srMask);

^

C:\Program Files (x86)\Arduino\libraries\NewliquidCrystal\LiquidCrystal_SR1W.h:293:79: note: in definition of macro 'SR1W_ATOMIC_WRITE_LOW'

#define SR1W_ATOMIC_WRITE_LOW(reg, mask) ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { *reg &= ~mask; }

^

C:\Program Files (x86)\Arduino\libraries\NewliquidCrystal\LiquidCrystal_SR1W.cpp:158:27: error: invalid type argument of unary '*' (have 'fio_register {aka unsigned char}')

SR1W_ATOMIC_WRITE_HIGH(srRegister, srMask);

^

C:\Program Files (x86)\Arduino\libraries\NewliquidCrystal\LiquidCrystal_SR1W.h:294:80: note: in definition of macro 'SR1W_ATOMIC_WRITE_HIGH'

#define SR1W_ATOMIC_WRITE_HIGH(reg, mask) ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { *reg |= mask; }

Okay so is the warning still possibly functional, or is it likely that it still wouldn't work

How could a variable that is not used possibly cause other code to fail?

C:\Users\Anthony\Documents\Arduino\Flow_Meter\Flow_Meter.ino:212:40: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

error("Card failed, or not present");

So, fix it:

     error((char *)"Card failed, or not present");

C:\Program Files (x86)\Arduino\libraries\Adafruit_BMP085_Unified-master\Adafruit_BMP085_U.cpp:332:15: warning: unused variable 'X1' [-Wunused-variable]

int32_t UT, X1, X2, B5; // following ds convention

So, delete X1.

C:\Users\Anthony\AppData\Local\Arduino15\packages\Intel\hardware\arc32\1.0.5\libraries\SD\src\utility\SdFile.cpp:907:40: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

if (curPosition_ != (32*(index + 1))) {

Again, you could fix this by declaring curPosition and index to be the same type, and adding a U suffix to the constants, if you use unsigned in the type.

C:\Program Files (x86)\Arduino\libraries\RTClib-master\RTClib.cpp:136:70: warning: operation on '((DateTime*)this)->DateTime::m' may be undefined [-Wsequence-point]

case 'J': m = date[1] == 'a' ? 1 : m = date[2] == 'n' ? 6 : 7; break;

What crappy code! This SHOULD be done using multiple statements so it is clear what it is doing. This requires too much study and some idea of what the surrounding code is doing.

In file included from C:\Program Files (x86)\Arduino\libraries\NewliquidCrystal\LiquidCrystal_SR1W.cpp:35:0:

Clearly, you are not going to be able to use this library on the 101.