thearn / Python-Arduino-Command-API

A Python library for communicating with Arduino microcontroller boards
415 stars 151 forks source link

How to wire sonar #1

Closed sdmeijer closed 11 years ago

sdmeijer commented 11 years ago

I have a HC-SR04. How should I wire it, so that I can use pulseIn or pulseIn_set?

Should it be like this (http://hackage.haskell.org/packages/archive/hArduino/latest/doc/html/System-Hardware-Arduino-SamplePrograms-Distance.html)? If so; it doesn't work with your example. Can you help me out?

thearn commented 11 years ago

The ultrasonic rangefinder that I've used is the same in this demo:

http://arduino.cc/en/Tutorial/Ping?from=Tutorial.UltrasoundSensor

which seems similar to the one which you posted, but not identical. I'll see what I can find about it. Have you used any pure Arduino sketches that have worked with it?

sdmeijer commented 11 years ago

Got it working with: pulseIn_set(pin, "HIGH")