SRO4 Ping Sensor won't work Arduino 101 but other Arduino works.

Why is newsing sensor library not working on arduino 101?


I don't know? Do you get an error? What is the error?

Many libraries are written for AVR-based microcontrollers only, and are not compatible with other architectures like the 101.

I'm using this newping sensor.

Here's the errors.

/Applications/untitled folder/Programming/Arduino/Arduino In constructor ‘NewPing::NewPing(uint8_t, uint8_t, unsigned int)’: /Applications/untitled folder/Programming/Arduino/Arduino error: cannot convert ‘uint32_t* {aka 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.

^ /Applications/untitled folder/Programming/Arduino/Arduino error: ‘portInputRegister’ was not declared in this scope _echoInput = portInputRegister(digitalPinToPort(echo_pin)); // Get the input port register for the echo pin.

Those errors confirm that the library does not support non-AVR boards.

You will need to use a different library or implement the functionality yourself. Try the 101 section - - the vast majority of discussion here is about the older boards, because they're cheap, and easy to design the hardware for (so there are loads of third party designs, and lots of people on here are designing their own AVR-based boards too).