Canada
Asked — Edited
Resolved Resolved by Dunning-Kruger!

Ultrasonic Sensor On Adc Ports

I am trying to get a HC - SR04 Ultrasonic sensor to work off of ADC ports and having a little difficulty. Before I go any further into frustration - can you run this sensor off of ADC ports?


ARC Pro

Upgrade to ARC Pro

Take control of your robot's destiny by subscribing to Synthiam ARC Pro, and watch it evolve into a versatile and responsive machine.

#2  

OK that explains it, maybe I'll try the another type I have that I got from Radio Shack. It only has 3 pins so maybe I can hook it up like my PIR to an ADC port.

#3  

Here is a ping (that works with the ezb4) that only uses one digital port... Price isn't bad and performance is similar to the SR04... inexpensive ping

#4  

@bhouston you'll need to use a digital port for the Parallax PING sensor (the one from Radio Shack) or 2 digital ports for the one from EZ-Robot (the HC-SR04). These are not designed for use on a ADC port.

Are you just experimenting, or have you ran out of digital ports?

#5  

@Richard R Thanks, That one is the same as the one from Radio Shack. Your new winnings should help you but some more EZB stuff. Congrats

@JustinRatliff, Yes, I have run out of digital ports. I'll have to get another v4 connected to my project.

#6  

@Bob... thanks... LOL... Can you use a sharp IR sensor instead? It uses analog....

#7  

Thanks Richard, I'm going to connect a second v4 to my project and that will give me all the digital ports I need. Do you know if there is a tutorial somewhere on running two boards? I've got them both connected but trying to find how to add a servo to the second board.

#8  

ping me on skype @bhouston.. I can help with the hook up

#9  

In general, your first board is board 0. All controls and script commands go to this board. All controls (except movement panel) have the option of selecting another board. Your second would be board 1, 3rd, board 2, etc.

All script commands also have the board number as an optional parameter.

Alan

#10  

I'm going to defer to @Rich on this one... How do you send servo commands (in a script) to a particular board?.... I am probably missing the obvious but, I can't get the servo(port,postion) command to accept a third argument (being the specific board the servo is attached...)

#11  

Quote:

How do you send servo commands (in a script) to a particular board?.... I am probably missing the obvious but, I can't get the servo(port,postion) command to accept a third argument (being the specific board the servo is attached...)

From the script help:

"Multiple EZ-B Boards

ARC supports multiple physical EZ-B Boards connected to your computer. You can specify the board by putting the board number in front of the port. For example: Servo(2.d0, 8) will move the D0 servo on EZ-B board #2 to position 8. If no board index is specified, the first board (zero) is assumed. If using more than one board, the first board is always responsible for movement panels."

Alan

#12  

Thanks, Alan. Makes sense, I will try that out. Where did you find that?

#13  

Quote:

Where did you find that?

Scroll down after the script commands in the script reference to the right of any script window. Maybe 3/4 of the way through the page or so.

Alan

#14  

@alan... I tried servo(1,D0,90) and it threw an error when I checked syntax... "This parameter requires 2 you have passed 3" or something like that... So instead of a comma after the first argument it should have been a period.... I guess I should have searched a little further... Thanks....:)

#15  

You need a period, not a comma between the board number and the port.

1.d0,50 not 1,d0,50

Alan

#16  

I should label this as resolved, thanks everyone for your responses. Richard answered my original question first so I'll give it to him. I'll start another post for using multiple v4,s as questions come up.