Issue using Ultrasonic sensor

userHead toddak 2018-04-15 22:02:13 4799 Views13 Replies
Hello all,

I've been working on a simple robotics project which I'm using the lattepanda to prototype, but I'm having issues with the Arduino, I think.

The sketch ran fine on an arduino uno, but since running it on the latte panda's leonardo the ultrasonic sensor isn't working.

The project has two motors that were being controller from pins 2, 3, 4 and 5. And then I was using Pin 6 for the trigpin, and 7 for the echopin.

When I posted on another forum, they suggested that the pin configuration could have issues with the timing, and so suggested that I use pins 5, 5, 8 and 9 for the motors, and then Pin 3 for the trigpin and Pin 2 for the echo pin. In both cases just using 5v for the UCC and Gnd to Gnd.

But in either of these cases the ultrasonic sensor never worked, however the motors always worked fine.

I'm controlling it all from max/msp, and that's all working pretty fine considering the simplicity of the sketch. And it all worked fine with when it was running from a laptop using the Arduino Uno.

Does anyone know what could be causing the issue with the sensor on the Arduino Leonardo? (I've posted this on the arduino forum, but people there are less familiar with the specific of the latte panda hardware, so am posting here).