Ultrasonic sensor

Discussion in 'Arduino IDE' started by orfeus, Dec 1, 2014.

  1. orfeus

    orfeus New Member

    Joined:
    Feb 25, 2014
    Messages:
    9
    Likes Received:
    0
    Hi guys,

    its anybody out there who has working Ultrasonic ranging module ( HC-SR04 ) ?

    Im using bi-directional lvl shifter (3,3V< - >5V), between Udoo and sensor.

    After upload .ino sketch, its all time returned "Out of range" on my serial. I tried it with two or more examples, but result was same.

    I thing its could be problem of pulseIN() function on Arduino Due -> https://github.com/arduino/Arduino/issues/1309

    But i cant confirm it, because i have a lack of knowledge with this.

    Can someone help me?

    I like Udoo, but this little things make me crazy ..

    Thank you and have a nice day
     
  2. delba

    delba Administrator Staff Member

    Joined:
    May 8, 2013
    Messages:
    1,064
    Likes Received:
    9
  3. hannan

    hannan New Member

    Joined:
    Mar 2, 2015
    Messages:
    3
    Likes Received:
    0
    when i verify the code i get this error


    Arduino: 0158 (Linux), Board: "Arduino Due (Programming Port)"

    /home/ubuntu/Arduino/libraries/NewPing/NewPing.cpp: In constructor 'NewPing::NewPing(uint8_t, uint8_t, unsigned int)':
    /home/ubuntu/Arduino/libraries/NewPing/NewPing.cpp:21:17: error: cannot convert 'RwReg* {aka volatile long unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in assignment
    _triggerOutput = portOutputRegister(digitalPinToPort(trigger_pin)); // Get the output port register for the trigger pin.
    ^
    /home/ubuntu/Arduino/libraries/NewPing/NewPing.cpp:22:13: error: cannot convert 'RoReg* {aka volatile long unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in assignment
    _echoInput = portInputRegister(digitalPinToPort(echo_pin)); // Get the input port register for the echo pin.
    ^
    /home/ubuntu/Arduino/libraries/NewPing/NewPing.cpp:24:75: error: 'portModeRegister' was not declared in this scope
    _triggerMode = (uint8_t *) portModeRegister(digitalPinToPort(trigger_pin)); // Get the port mode register for the trigger pin.
    ^
    Error compiling.
     

Share This Page