Author Topic: Question about using lsm303c library with simblee library on arduino 1.6.11  (Read 73 times)

ttn115

  • RFduino Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Hi all,

I want to use lsm303c with simblee , but got some error.

Environment:
win7 x64
arduino 1.6.11
simblee lib v1.1.1
SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1

before i using the example : MinimalistExample ,some basic examples are woking fine, any suggestion i can do to fix these errors?

i got a lot of error code when i verify the exmaple as below:
Arduino: 1.6.11 (Windows 7), Board: "Simblee"

In file included from C:\Program Files (x86)\Arduino\portable\packages\Simblee\hardware\Simblee\1.1.1\cores\arduino/Arduino.h:44:0,

                 from C:\Program Files (x86)\Arduino\portable\packages\Simblee\hardware\Simblee\1.1.1\variants\Simblee/variant.h:38,

                 from C:\Program Files (x86)\Arduino\portable\packages\Simblee\hardware\Simblee\1.1.1\libraries\Wire/Wire.h:35,

                 from C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.h:5,

                 from C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.cpp:1:

C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.cpp: In member function 'status_t LSM303C::begin(InterfaceMode_t, MAG_DO_t, MAG_FS_t, MAG_BDU_t, MAG_OMXY_t, MAG_OMZ_t, MAG_MD_t, ACC_FS_t, ACC_BDU_t, uint8_t, ACC_ODR_t)':

C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.h:33:20: error: 'DDRB' was not declared in this scope

 #define DIR_REG    DDRB

                    ^

C:\Program Files (x86)\Arduino\portable\packages\Simblee\hardware\Simblee\1.1.1\cores\arduino/wiring_constants.h:123:30: note: in definition of macro 'bitSet'

 #define bitSet(value, bit) ((value) |= (1UL << (bit)))

                              ^

C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.cpp:47:12: note: in expansion of macro 'DIR_REG'

     bitSet(DIR_REG, CSBIT_MAG);

            ^

C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.h:24:20: error: 'PORTB' was not declared in this scope

 #define CSPORT_MAG PORTB

                    ^

C:\Program Files (x86)\Arduino\portable\packages\Simblee\hardware\Simblee\1.1.1\cores\arduino/wiring_constants.h:123:30: note: in definition of macro 'bitSet'

 #define bitSet(value, bit) ((value) |= (1UL << (bit)))

                              ^

C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.cpp:51:12: note: in expansion of macro 'CSPORT_MAG'

     bitSet(CSPORT_MAG, CSBIT_MAG);

            ^

C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.cpp:57:44: error: '_BV' was not declared in this scope

     SPI_WriteByte(MAG, MAG_CTRL_REG3, _BV(2));

                                            ^

C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.cpp:62:10: error: 'class TwoWire' has no member named 'setClock'

     Wire.setClock(400000L);

          ^

C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.cpp: In member function 'uint8_t LSM303C::SPI_ReadByte(CHIP_t, uint8_t)':

C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.cpp:741:16: error: '_BV' was not declared in this scope

   data |= _BV(7);

                ^

In file included from C:\Program Files (x86)\Arduino\portable\packages\Simblee\hardware\Simblee\1.1.1\cores\arduino/Arduino.h:44:0,

                 from C:\Program Files (x86)\Arduino\portable\packages\Simblee\hardware\Simblee\1.1.1\variants\Simblee/variant.h:38,

                 from C:\Program Files (x86)\Arduino\portable\packages\Simblee\hardware\Simblee\1.1.1\libraries\Wire/Wire.h:35,

                 from C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.h:5,

                 from C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.cpp:1:

C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.h:33:20: error: 'DDRB' was not declared in this scope

 #define DIR_REG    DDRB

                    ^

C:\Program Files (x86)\Arduino\portable\packages\Simblee\hardware\Simblee\1.1.1\cores\arduino/wiring_constants.h:123:30: note: in definition of macro 'bitSet'

 #define bitSet(value, bit) ((value) |= (1UL << (bit)))

                              ^

C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.cpp:744:10: note: in expansion of macro 'DIR_REG'

   bitSet(DIR_REG, DATABIT);

          ^

C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.h:24:20: error: 'PORTB' was not declared in this scope

 #define CSPORT_MAG PORTB

                    ^

C:\Program Files (x86)\Arduino\portable\packages\Simblee\hardware\Simblee\1.1.1\cores\arduino/wiring_constants.h:124:32: note: in definition of macro 'bitClear'

 #define bitClear(value, bit) ((value) &= ~(1UL << (bit)))

                                ^

C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.cpp:752:14: note: in expansion of macro 'CSPORT_MAG'

     bitClear(CSPORT_MAG, CSBIT_MAG);

              ^

C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.h:31:20: error: 'PORTB' was not declared in this scope

 #define DATAPORTO  PORTB

                    ^

C:\Program Files (x86)\Arduino\portable\packages\Simblee\hardware\Simblee\1.1.1\cores\arduino/wiring_constants.h:123:30: note: in definition of macro 'bitSet'

 #define bitSet(value, bit) ((value) |= (1UL << (bit)))

                              ^

C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.cpp:764:5: note: in expansion of macro 'bitWrite'

     bitWrite(DATAPORTO, DATABIT, data & 0x80);

     ^

C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.cpp:764:14: note: in expansion of macro 'DATAPORTO'

     bitWrite(DATAPORTO, DATABIT, data & 0x80);

              ^

C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.h:28:20: error: 'PORTB' was not declared in this scope

 #define CLKPORT    PORTB

                    ^

C:\Program Files (x86)\Arduino\portable\packages\Simblee\hardware\Simblee\1.1.1\cores\arduino/wiring_constants.h:124:32: note: in definition of macro 'bitClear'

 #define bitClear(value, bit) ((value) &= ~(1UL << (bit)))

                                ^

C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.cpp:781:14: note: in expansion of macro 'CLKPORT'

     bitClear(CLKPORT, CLKBIT);

              ^

C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.h:30:20: error: 'PINB' was not declared in this scope

 #define DATAPORTI  PINB

                    ^

C:\Program Files (x86)\Arduino\portable\packages\Simblee\hardware\Simblee\1.1.1\cores\arduino/wiring_constants.h:122:32: note: in definition of macro 'bitRead'

 #define bitRead(value, bit) (((value) >> (bit)) & 0x01)

                                ^

C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.cpp:784:17: note: in expansion of macro 'DATAPORTI'

     if (bitRead(DATAPORTI, DATABIT))

                 ^

C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.h:24:20: error: 'PORTB' was not declared in this scope

 #define CSPORT_MAG PORTB

                    ^

C:\Program Files (x86)\Arduino\portable\packages\Simblee\hardware\Simblee\1.1.1\cores\arduino/wiring_constants.h:123:30: note: in definition of macro 'bitSet'

 #define bitSet(value, bit) ((value) |= (1UL << (bit)))

                              ^

C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.cpp:794:12: note: in expansion of macro 'CSPORT_MAG'

     bitSet(CSPORT_MAG, CSBIT_MAG);

            ^

C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.cpp: In member function 'status_t LSM303C::SPI_WriteByte(CHIP_t, uint8_t, uint8_t)':

C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.cpp:822:16: error: '_BV' was not declared in this scope

   reg &= ~_BV(7);

                ^

In file included from C:\Program Files (x86)\Arduino\portable\packages\Simblee\hardware\Simblee\1.1.1\cores\arduino/Arduino.h:44:0,

                 from C:\Program Files (x86)\Arduino\portable\packages\Simblee\hardware\Simblee\1.1.1\variants\Simblee/variant.h:38,

                 from C:\Program Files (x86)\Arduino\portable\packages\Simblee\hardware\Simblee\1.1.1\libraries\Wire/Wire.h:35,

                 from C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.h:5,

                 from C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.cpp:1:

C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.h:33:20: error: 'DDRB' was not declared in this scope

 #define DIR_REG    DDRB

                    ^

C:\Program Files (x86)\Arduino\portable\packages\Simblee\hardware\Simblee\1.1.1\cores\arduino/wiring_constants.h:123:30: note: in definition of macro 'bitSet'

 #define bitSet(value, bit) ((value) |= (1UL << (bit)))

                              ^

C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.cpp:826:10: note: in expansion of macro 'DIR_REG'

   bitSet(DIR_REG, DATABIT);

          ^

C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.h:24:20: error: 'PORTB' was not declared in this scope

 #define CSPORT_MAG PORTB

                    ^

C:\Program Files (x86)\Arduino\portable\packages\Simblee\hardware\Simblee\1.1.1\cores\arduino/wiring_constants.h:124:32: note: in definition of macro 'bitClear'

 #define bitClear(value, bit) ((value) &= ~(1UL << (bit)))

                                ^

C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.cpp:834:14: note: in expansion of macro 'CSPORT_MAG'

     bitClear(CSPORT_MAG, CSBIT_MAG);

              ^

C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.h:31:20: error: 'PORTB' was not declared in this scope

 #define DATAPORTO  PORTB

                    ^

C:\Program Files (x86)\Arduino\portable\packages\Simblee\hardware\Simblee\1.1.1\cores\arduino/wiring_constants.h:123:30: note: in definition of macro 'bitSet'

 #define bitSet(value, bit) ((value) |= (1UL << (bit)))

                              ^

C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.cpp:846:5: note: in expansion of macro 'bitWrite'

     bitWrite(DATAPORTO, DATABIT, twoBytes & 0x8000);

     ^

C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.cpp:846:14: note: in expansion of macro 'DATAPORTO'

     bitWrite(DATAPORTO, DATABIT, twoBytes & 0x8000);

              ^

C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.h:24:20: error: 'PORTB' was not declared in this scope

 #define CSPORT_MAG PORTB

                    ^

C:\Program Files (x86)\Arduino\portable\packages\Simblee\hardware\Simblee\1.1.1\cores\arduino/wiring_constants.h:123:30: note: in definition of macro 'bitSet'

 #define bitSet(value, bit) ((value) |= (1UL << (bit)))

                              ^

C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1\src\SparkFunLSM303C.cpp:859:12: note: in expansion of macro 'CSPORT_MAG'

     bitSet(CSPORT_MAG, CSBIT_MAG);

            ^

Multiple libraries were found for "SparkFunIMU.h"
 Used: C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library-V_1.0.1
 Not used: C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout
 Not used: C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout
 Not used: C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout
 Not used: C:\Program Files (x86)\Arduino\portable\sketchbook\libraries\SparkFun_LSM303C_6_DOF_IMU_Breakout
exit status 1
Error compiling for board Simblee.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

tolson

  • Global Moderator
  • *****
  • Posts: 812
  • Karma: +19/-0
    • View Profile
    • Thomas Olson Consulting
More verbose is not needed. That library is for AVR microprocessors. Simblee is ARM Cortex M0. Look for ARM based libraries.

ttn115

  • RFduino Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
thanks for you reply.
i will try to find the another lib, or modify the code to fit the mcu.
« Last Edit: March 28, 2017, 03:59:00 PM by ttn115 »