Can a 4-pin HC-SR04 ultrasonic sensor be used on the parallax board, i.e. with PropellerC?
dakotaknut
Posts: 9
in Robotics
Can a 4-pin HC-SR04 ultrasonic sensor be used on the parallax board, i.e. with PropellerC?
I assume so.
Is there a tutorial or description.
I have an activitybot and have it working with the Parallax 3-pin sensor.
I had purchased two more sensors for use with an Arduino board I was going to try with some projects I have in mind.
I am working with my son on a maze solving robot and would like to connect three sensors.
Thanks for any help
dakotaknut
I assume so.
Is there a tutorial or description.
I have an activitybot and have it working with the Parallax 3-pin sensor.
I had purchased two more sensors for use with an Arduino board I was going to try with some projects I have in mind.
I am working with my son on a maze solving robot and would like to connect three sensors.
Thanks for any help
dakotaknut
Comments
Welcome to the forums! Yes, you can use those sensors with an Activity board. The PING is a much higher quality unit, but we've all been tempted by those $1 HC-SR04s. Like the PING shown at http://learn.parallax.com/activitybot/build-and-test-ping-sensor-circuit, you'll power it with 5V and use two resistors to interface to the 3.3V Propeller.
The four pin HC-SR04 has seperate TRIGger and ECHO pins, requiring two Prop I/O pins. BUT... there is a top secret, insider-exclusive, eyes-only, password-protected, secret-handshake-required, simple one-resistor modification to make it function on just one I/O pin. See this long-winded thread with lots of juicy info: http://forums.parallax.com/discussion/comment/1301893/#Comment_1301893
https://gist.github.com/flakas/3294829#file-hc-sr04-ino-L82
There are some build problems
Serial.begin doesn't work, but I don't think I need it
OUTPUT, LOW, and HIGH are all problems.
The example didn't show the header file I would need.
I am looking for examples of the use of these.
For example pinMode([pin], OUTOUT);
and digitalwrite([pin], LOW);
LOW and HIGH are undoubtedly as simple as 0 and 1.
I recollect seeing OUTPUT in an example sometime back when I was working on this a little bit.
I would like to use a header file for these. I assume that would be the best.
Thank you
I can't wait to take a look at this.