Skip to content

Cant compile on Arduino Uno wifi rev 2 #28

@KrishnaMBhattarai

Description

@KrishnaMBhattarai

Hello,

I am following the example shown on this page https://learn.sparkfun.com/tutorials/lidar-lite-v3-hookup-guide/all and I placed the cloned repository under my user's arduino library directory which is /Users/jung/Documents/Arduino/libraries

jung@MacOS-[/Users/jung/Documents/Arduino/libraries]:~$ ls
LIDARLite_Arduino_Library-master readme.txt

I have a Arduino Uno wifi rev 2 and a LIDAR Lite v3 and when I tried to compile the code I get this error message below. Please help!

Here is the complete code:

/**
 * LIDARLite I2C Example
 * Author: Garmin
 * Modified by: Shawn Hymel (SparkFun Electronics)
 * Date: June 29, 2017
 * 
 * Read distance from LIDAR-Lite v3 over I2C
 * 
 * See the Operation Manual for wiring diagrams and more information:
 * http://static.garmin.com/pumac/LIDAR_Lite_v3_Operation_Manual_and_Technical_Specifications.pdf
 */

#include <Wire.h>
#include <LIDARLite.h>

// Globals
LIDARLite lidarLite;
int cal_cnt = 0;

void setup()
{
  Serial.begin(9600); // Initialize serial connection to display distance readings

  lidarLite.begin(0, true); // Set configuration to default and I2C to 400 kHz
  lidarLite.configure(0); // Change this number to try out alternate configurations
}

void loop()
{
  int dist;

  // At the beginning of every 100 readings,
  // take a measurement with receiver bias correction
  if ( cal_cnt == 0 ) {
    dist = lidarLite.distance();      // With bias correction
  } else {
    dist = lidarLite.distance(false); // Without bias correction
  }

  // Increment reading counter
  cal_cnt++;
  cal_cnt = cal_cnt % 100;

  // Display distance
  Serial.print(dist);
  Serial.println(" cm");

  delay(10);
}

and here is the log

/Users/jung/Documents/Arduino/libraries/LIDARLite_Arduino_Library-master/src/LIDARLite_v4LED.cpp: In member function 'void LIDARLite_v4LED::read(uint8_t, uint8_t*, uint8_t, uint8_t)':
/Users/jung/Documents/Arduino/libraries/LIDARLite_Arduino_Library-master/src/LIDARLite_v4LED.cpp:426:5: error: no matching function for call to 'TwoWire::requestFrom(uint8_t&, uint8_t&, uint8_t&, int, bool)'
     );
     ^
In file included from /Users/jung/Documents/Arduino/libraries/LIDARLite_Arduino_Library-master/src/LIDARLite_v4LED.cpp:27:0:
/Users/jung/Library/Arduino15/packages/arduino/hardware/megaavr/1.8.7/libraries/Wire/src/Wire.h:61:12: note: candidate: virtual size_t TwoWire::requestFrom(uint8_t, size_t)
     size_t requestFrom(uint8_t, size_t);
            ^~~~~~~~~~~
/Users/jung/Library/Arduino15/packages/arduino/hardware/megaavr/1.8.7/libraries/Wire/src/Wire.h:61:12: note:   candidate expects 2 arguments, 5 provided
/Users/jung/Library/Arduino15/packages/arduino/hardware/megaavr/1.8.7/libraries/Wire/src/Wire.h:62:12: note: candidate: virtual size_t TwoWire::requestFrom(uint8_t, size_t, bool)
     size_t requestFrom(uint8_t, size_t, bool);
            ^~~~~~~~~~~
/Users/jung/Library/Arduino15/packages/arduino/hardware/megaavr/1.8.7/libraries/Wire/src/Wire.h:62:12: note:   candidate expects 3 arguments, 5 provided
/Users/jung/Library/Arduino15/packages/arduino/hardware/megaavr/1.8.7/libraries/Wire/src/Wire.h:63:12: note: candidate: size_t TwoWire::requestFrom(int, int)
     size_t requestFrom(int, int);
            ^~~~~~~~~~~
/Users/jung/Library/Arduino15/packages/arduino/hardware/megaavr/1.8.7/libraries/Wire/src/Wire.h:63:12: note:   candidate expects 2 arguments, 5 provided
/Users/jung/Library/Arduino15/packages/arduino/hardware/megaavr/1.8.7/libraries/Wire/src/Wire.h:64:12: note: candidate: size_t TwoWire::requestFrom(int, int, int)
     size_t requestFrom(int, int, int);
            ^~~~~~~~~~~
/Users/jung/Library/Arduino15/packages/arduino/hardware/megaavr/1.8.7/libraries/Wire/src/Wire.h:64:12: note:   candidate expects 3 arguments, 5 provided
/Users/jung/Documents/Arduino/libraries/LIDARLite_Arduino_Library-master/src/LIDARLite_v3HP.cpp: In member function 'void LIDARLite_v3HP::read(uint8_t, uint8_t*, uint8_t, uint8_t)':
/Users/jung/Documents/Arduino/libraries/LIDARLite_Arduino_Library-master/src/LIDARLite_v3HP.cpp:455:5: error: no matching function for call to 'TwoWire::requestFrom(uint8_t&, uint8_t&, uint8_t&, int, bool)'
     );
     ^
In file included from /Users/jung/Documents/Arduino/libraries/LIDARLite_Arduino_Library-master/src/LIDARLite_v3HP.cpp:27:0:
/Users/jung/Library/Arduino15/packages/arduino/hardware/megaavr/1.8.7/libraries/Wire/src/Wire.h:61:12: note: candidate: virtual size_t TwoWire::requestFrom(uint8_t, size_t)
     size_t requestFrom(uint8_t, size_t);
            ^~~~~~~~~~~
/Users/jung/Library/Arduino15/packages/arduino/hardware/megaavr/1.8.7/libraries/Wire/src/Wire.h:61:12: note:   candidate expects 2 arguments, 5 provided
/Users/jung/Library/Arduino15/packages/arduino/hardware/megaavr/1.8.7/libraries/Wire/src/Wire.h:62:12: note: candidate: virtual size_t TwoWire::requestFrom(uint8_t, size_t, bool)
     size_t requestFrom(uint8_t, size_t, bool);
            ^~~~~~~~~~~
/Users/jung/Library/Arduino15/packages/arduino/hardware/megaavr/1.8.7/libraries/Wire/src/Wire.h:62:12: note:   candidate expects 3 arguments, 5 provided
/Users/jung/Library/Arduino15/packages/arduino/hardware/megaavr/1.8.7/libraries/Wire/src/Wire.h:63:12: note: candidate: size_t TwoWire::requestFrom(int, int)
     size_t requestFrom(int, int);
            ^~~~~~~~~~~
/Users/jung/Library/Arduino15/packages/arduino/hardware/megaavr/1.8.7/libraries/Wire/src/Wire.h:63:12: note:   candidate expects 2 arguments, 5 provided
/Users/jung/Library/Arduino15/packages/arduino/hardware/megaavr/1.8.7/libraries/Wire/src/Wire.h:64:12: note: candidate: size_t TwoWire::requestFrom(int, int, int)
     size_t requestFrom(int, int, int);
            ^~~~~~~~~~~
/Users/jung/Library/Arduino15/packages/arduino/hardware/megaavr/1.8.7/libraries/Wire/src/Wire.h:64:12: note:   candidate expects 3 arguments, 5 provided
exit status 1
Error compiling for board Arduino Uno WiFi Rev2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions