Skip to content

hexbright.cpp fails to compile on ubuntu 12.04.1 "precise" #17

Description

@eichin

Wire.h comes from arduino-core 1:1.0+dfsg-9.

hexbright/libraries/hexbright/hexbright.cpp: In static member function 'static void hexbright::read_accelerometer()':
hexbright/libraries/hexbright/hexbright.cpp:634:28: error: call of overloaded 'write(int)' is ambiguous
/usr/share/arduino/libraries/Wire/Wire.h:55:20: note: candidates are: virtual size_t TwoWire::write(uint8_t)
/usr/share/arduino/hardware/arduino/cores/arduino/Print.h:49:12: note:                 size_t Print::write(const char*)
hexbright/libraries/hexbright/hexbright.cpp:635:31: error: no matching function for call to 'TwoWire::endTransmission(int)'
/usr/share/arduino/libraries/Wire/Wire.h:52:13: note: candidate is: uint8_t TwoWire::endTransmission()
hexbright/libraries/hexbright/hexbright.cpp: In static member function 'static unsigned char hexbright::read_accelerometer(unsigned char)':
hexbright/libraries/hexbright/hexbright.cpp:659:31: error: no matching function for call to 'TwoWire::endTransmission(int)'
/usr/share/arduino/libraries/Wire/Wire.h:52:13: note: candidate is: uint8_t TwoWire::endTransmission()

This diff actually gets it to compile, and is enough to make at least tactical.ino actually work on the hexbright...

diff --git a/libraries/hexbright/hexbright.cpp b/libraries/hexbright/hexbright.cpp
index 0e0eee9..f57e084 100755
--- a/libraries/hexbright/hexbright.cpp
+++ b/libraries/hexbright/hexbright.cpp
@@ -631,8 +631,8 @@ void hexbright::read_accelerometer() {
   next_vector();
   while(1) {
     Wire.beginTransmission(ACC_ADDRESS);
-    Wire.write(ACC_REG_XOUT);          // starting with ACC_REG_XOUT,
-    Wire.endTransmission(false);
+    Wire.write(ACC_REG_XOUT, sizeof(ACC_REG_XOUT));          // starting with ACC_REG_XOUT,
+    Wire.endTransmission();
     Wire.requestFrom(ACC_ADDRESS, 4);  // read 4 registers (X,Y,Z), TILT
     for(int i=0; i<4; i++) {
       if (!Wire.available())
@@ -656,7 +656,7 @@ unsigned char hexbright::read_accelerometer(unsigned char acc_reg) {
   if (!digitalReadFast(DPIN_ACC_INT)) {
     Wire.beginTransmission(ACC_ADDRESS);
     Wire.write(acc_reg);
-    Wire.endTransmission(false);       // End, but do not stop!
+    Wire.endTransmission();       // End, but do not stop!
     Wire.requestFrom(ACC_ADDRESS, 1);
     return Wire.read();
   }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions