Ping Sonar Altimeter and Echosounder with embedded C microcontroller

Trying to use the Ping Sonar Altimeter and Echosounder with an STM32 family microcontroller (using the NUCLEO-L4P5ZG for development).

I have not managed to establish contact with the sonar, does anyone have any ideas on how I can solve it other than trying to rewrite the Arduino Library to function with embedded C?

Hi @OASimen, welcome to the forum :slight_smile:

Are you aware of our ping-cpp library? We unfortunately don’t have examples written for it at this point, but the intent is that we’ll end up refactoring ping-arduino to be based off ping-cpp anyway, so we don’t have the same functionality written in multiple places.

You should be able to use ping-cpp to support your device, but if you have trouble doing so then feel free to ask for more help and I can ask our software team to provide an example or specify the steps required to support a new device type :slight_smile:

Hi,

I am almost done re-writing the ping-cpp library to function with my STM32 chip (tried implementing the c++ library directly, but it overloaded the memory).

There is just one final hurdle I have not managed to get over.
When writing to the sensor, the message sent from master (MCU) to slave (sensor) consists of a header, payload, and checksum right?

I have found a way to recreate the header and the checksum, but what do I use as payload when requesting that the sensor should send out a ping?

Mainly trying to get Distance (1211 and 1212 found here ping1d - Ping Protocol ) to work

If I’m understanding what you’re after correctly, a “get” message is sent as a general_request - implemented here in ping-cpp.

That said, I’m not sure why you would need to create your own version of the code. From a brief search online it seems like your board type is marketed as “supports arduino”, so maybe it’s worth trying to set up using our ping-arduino library?