Arduino Zero with DRV8830

Hi,

I am trying to use the DRV8830 with the arduino zero using the sparkfun minimoto lbr but I keep getting the error:

'TWBR' was not declared in this scope
TWBR = 72;
'TWCR' was not declared in this scope

TWCR = START_COND; // Send a start condition

^

as well as some other similar error messages. From what I can understand it seems like its because the lbr is designed for the uno. How can I adjust it to work with the zero?

Thanks,

Aaron

aaron26:
as well as some other similar error messages. From what I can understand it seems like its because the lbr is designed for the uno. How can I adjust it to work with the zero?

You have not posted your program
You have not told us what "lbr" you are using
You have not posted the full error message.

How can we help?

...R

My appologies:

C:\Users\Aaron \Documents\Arduino\libraries\SparkFun_MiniMoto\src\SparkFunMiniMoto.cpp: In constructor 'MiniMoto::MiniMoto(byte)':

C:\Users\Aaron \Documents\Arduino\libraries\SparkFun_MiniMoto\src\SparkFunMiniMoto.cpp:25:3: error: '_addr' was not declared in this scope

_addr = addr;

^

C:\Users\Aaron \Documents\Arduino\libraries\SparkFun_MiniMoto\src\SparkFunMiniMoto.cpp:29:3: error: 'TWBR' was not declared in this scope

TWBR = 72;

^

C:\Users\Aaron \Documents\Arduino\libraries\SparkFun_MiniMoto\src\SparkFunMiniMoto.cpp: In member function 'void MiniMoto::I2CReadBytes(byte, byte*, byte)':

C:\Users\Aaron \Documents\Arduino\libraries\SparkFun_MiniMoto\src\SparkFunMiniMoto.cpp:86:3: error: 'TWCR' was not declared in this scope

TWCR = START_COND; // Send a start condition

^

C:\Users\Aaron \Documents\Arduino\libraries\SparkFun_MiniMoto\src\SparkFunMiniMoto.cpp:87:21: error: 'TWINT' was not declared in this scope

while (!(TWCR&(1<<TWINT))); // When TWINT is set, start is complete, and we

^

C:\Users\Aaron \Documents\Arduino\libraries\SparkFun_MiniMoto\src\SparkFunMiniMoto.cpp:89:3: error: 'TWDR' was not declared in this scope

TWDR = _addr; // Load the slave address

^

C:\Users\Aaron \Documents\Arduino\libraries\SparkFun_MiniMoto\src\SparkFunMiniMoto.cpp:89:10: error: '_addr' was not declared in this scope

TWDR = _addr; // Load the slave address

^

C:\Users\Aaron \Documents\Arduino\libraries\SparkFun_MiniMoto\src\SparkFunMiniMoto.cpp:93:21: error: 'TWINT' was not declared in this scope

while (!(TWCR&(1<<TWINT))); // Wait for TWINT again.

^

C:\Users\Aaron \Documents\Arduino\libraries\SparkFun_MiniMoto\src\SparkFunMiniMoto.cpp:99:21: error: 'TWINT' was not declared in this scope

while (!(TWCR&(1<<TWINT))); // Wait for TWINT again.

^

C:\Users\Aaron \Documents\Arduino\libraries\SparkFun_MiniMoto\src\SparkFunMiniMoto.cpp:105:21: error: 'TWINT' was not declared in this scope

while (!(TWCR&(1<<TWINT))); // When TWINT is set, start is complete, and we

^

C:\Users\Aaron \Documents\Arduino\libraries\SparkFun_MiniMoto\src\SparkFunMiniMoto.cpp:111:21: error: 'TWINT' was not declared in this scope

while (!(TWCR&(1<<TWINT))); // Wait for TWINT again.

^

C:\Users\Aaron \Documents\Arduino\libraries\SparkFun_MiniMoto\src\SparkFunMiniMoto.cpp:121:23: error: 'TWINT' was not declared in this scope

while (!(TWCR&(1<<TWINT))); // Wait for TWINT again.

^

C:\Users\Aaron \Documents\Arduino\libraries\SparkFun_MiniMoto\src\SparkFunMiniMoto.cpp: In member function 'void MiniMoto::I2CWriteBytes(byte, byte*, byte)':

C:\Users\Aaron \Documents\Arduino\libraries\SparkFun_MiniMoto\src\SparkFunMiniMoto.cpp:132:3: error: 'TWCR' was not declared in this scope

TWCR = START_COND; // Send a start condition

^

C:\Users\Aaron \Documents\Arduino\libraries\SparkFun_MiniMoto\src\SparkFunMiniMoto.cpp:133:21: error: 'TWINT' was not declared in this scope

while (!(TWCR&(1<<TWINT))); // When TWINT is set, start is complete, and we

^

C:\Users\Aaron \Documents\Arduino\libraries\SparkFun_MiniMoto\src\SparkFunMiniMoto.cpp:135:3: error: 'TWDR' was not declared in this scope

TWDR = _addr; // Load the slave address

^

C:\Users\Aaron \Documents\Arduino\libraries\SparkFun_MiniMoto\src\SparkFunMiniMoto.cpp:135:10: error: '_addr' was not declared in this scope

TWDR = _addr; // Load the slave address

^

C:\Users\Aaron \Documents\Arduino\libraries\SparkFun_MiniMoto\src\SparkFunMiniMoto.cpp:139:21: error: 'TWINT' was not declared in this scope

while (!(TWCR&(1<<TWINT))); // Wait for TWINT again.

^

C:\Users\Aaron \Documents\Arduino\libraries\SparkFun_MiniMoto\src\SparkFunMiniMoto.cpp:145:21: error: 'TWINT' was not declared in this scope

while (!(TWCR&(1<<TWINT))); // Wait for TWINT again.

^

C:\Users\Aaron \Documents\Arduino\libraries\SparkFun_MiniMoto\src\SparkFunMiniMoto.cpp:155:23: error: 'TWINT' was not declared in this scope

while (!(TWCR&(1<<TWINT))); // Wait for TWINT again.

^

exit status 1
Error compiling for board Arduino/Genuino Zero (Native USB Port).

SparkFunMiniMoto.cpp (6.72 KB)

SparkFunMiniMoto.h (1.4 KB)

wireless_motor.ino (2.7 KB)