New Ping with STM32F412Vx

Issue #59 resolved
Somansh Raj created an issue

Hi Tim, I’ve tried multiple attempts to get the STM32F4xx working with the New Ping by making suitable changes yet failed every time.

Since the above lib. does support the particle ( Photon & Electron ) devices which use STM32F2xx, I would like to get help in understanding how can I make this work. Any guidance from you will be highly appreciated.

Comments (16)

  1. Tim Eckel repo owner

    Have you tried changing the NewPing.h file, line 170 from:

    #define TIMER_ENABLED true

    to:

    #define TIMER_ENABLED false

  2. Somansh Raj Account Deactivated reporter

    I need the sonar.check_timer method to be working with STM32F4 series. Hence cannot do the following : #define TIMER_ENABLED false

  3. Somansh Raj Account Deactivated reporter

    Hi Tim,

    We tested the branch with the hardware and it is working well with the STM32F412Vx board. Also we added one more additional board i.e., STM32F411VE-DISCOVERY which is working as well.

    Attached

  4. Somansh Raj Account Deactivated reporter

    However, in both the boards, sonar ( Gravity - URM09 ) doesn’t work when connected to pins PA7, PC2 and PC4 but works with the pins PA0, PB0, PC0.

    Code attached below for the same

  5. Tim Eckel repo owner

    I see a few problems with your code.

    First, you shouldn’t be using the same pin for trigger and echo. That should be two different pins. There’s only certain microcontrollers and sensors that will work with one pin. Only a few sensors will work this way. Others may work if you add a capacitor, but that again is hit or miss. So, NEVER use a single pin! Do ALL of your testing using two pins, as the sensor was designed. Only after everything is working 100% would you EVER try to use a single pin. Just don’t do that, you’re making things MUCH harder on yourself as a result.

    Secondly, why the heck are you using the 15 Sensors Example Sketch as your code base? Have you read the warnings? It’s right in the top or code! Basically, my MANY warnings say to NOT use the 15 Sensor sketch! As all my warnings say, use the 3 Sensor Sketch example instead:

    https://bitbucket.org/teckel12/arduino-new-ping/wiki/Home#!ping-3-sensors-sketch

    I have no idea why everyone always wants to make things more difficult by using the 15 sensor example instead of the 3 sensor example when I give warning after warning! Please people, stop doing what I’m telling you NOT to do!

    Anyway, your problems are directly due to not following the instructions. No code will be changed or further time wasted if you can’t be bothered by reading the instructions and MANY warnings. Good luck, you’re on your own.

  6. Tim Eckel repo owner

    User is not following the instructions. Is trying to use a single pin instead of 2 pins and is using an example sketch which is FILLED with warnings on not using it, but using a different example sketch instead. The problems are directly related to not following instructions.

    Closed.

  7. Log in to comment