1 Reply Latest reply on Apr 21, 2016 5:46 PM by Intel Corporation

    Getting error while using HC-SR04 Ultrasonic Sensor on Eclipse IDE

    davulist

      Hello,

      I am trying to getting the distance by using HC-SR04 Ultrasonic sensor with my intel galileo gen 1. I'm coding on Eclipse IDE. I found a sample code from here: upm/hcsr04.cxx at master · intel-iot-devkit/upm · GitHub I added the header by using IoT Sensor Support on Eclipse. Now I found another cpp file from here: upm/hcsr04.cxx at master · intel-iot-devkit/upm · GitHub This cpp file has codes for constructor and functions. How can I add this second cpp file to my project? Will there be two cpp files in my project's src file? I copied and pasted this second cpp file on my project and it gives errors like that:

       

      Multiple markers at this line

        - Member 'm_RisingTimeStamp' was not initialized in this

        constructor

        - Member 'm_InterruptCounter' was not initialized in this

        constructor

        - Member 'm_FallingTimeStamp' was not initialized in this

        constructor

        - Member 'm_doWork' was not initialized in this constructor

       

      And also it says "unused variable 'error' [-Wunused-variable]"  for this line: mraa_result_t error  = MRAA_SUCCESS;

       

      Since it's a sample code, I wasn't expecting any errors. How can I solve this problem?

       

      Thanks.