Show Posts
Pages: 1 2 [3] 4 5 ... 35
31  Using Arduino / Programming Questions / Re: Delay and digitalWrite Inconsistency on: May 20, 2014, 01:02:18 pm
Quote
I would also suggest using port register calls instead of digitalWrite.
What! That would make the pulses even faster, so even more would be missed.

I'm thinking accuracy, not speed.  The wait time between pulses may need to be adjusted if you used port register calls instead of digitalWrite.  But, the wait time would be more accurate as well.  You're right, in that he's probably just trying to do too many pulses too quickly.  Slow the time down between pulses but don't use digitalWrite.

Maybe I just have a thing against digitalWrite.  I *NEVER* use it for the ATmega8 processors.  I also never use delay(), so maybe this entire thread rubbed me the wrong way.

Tim
32  Using Arduino / Programming Questions / Re: Delay and digitalWrite Inconsistency on: May 20, 2014, 12:10:13 pm
I actually ended up finding someone who had made pretty much this exact project, i'll post the link just for anyone else who wants to look at it. I'm hoping to find the solution to my problems in these notes.

http://forums.shoryuken.com/discussion/15876/the-programmable-stick-pad-thread/p4

That's some "special" programming there.  Getting back to the original code, I would also suggest using port register calls instead of digitalWrite.  If you're trying to make the timing as exact as possible, not using delays and using port registers are the way to go.

Tim
33  Using Arduino / Programming Questions / Re: Something is wrong on: May 20, 2014, 12:02:58 pm
What's wrong is the uber-ambiguous title to this thread.

Tim
34  Using Arduino / Programming Questions / Re: Problem implementing ultrasonic interrupt (new ping library) on: May 20, 2014, 12:00:37 pm
Thats great Tim, thanks for the pointers and email reply. A real help for possible direction to start looking.

I hope I can get this reviewed and improved soon.

The camera uses SPI, which is uses pins 10-13.  You're also trying to connect the ultrasonic sensor to pins 11 and 12.  So, you have two things wired to the same pins, which of course will cause a problem.  Always know what pins a shield uses and always try different pins if you ever have a problem.  Even if a shield isn't connected to a pin, it could use a timer that's tied to a pin which could cause a conflict.

Tim
35  Using Arduino / Programming Questions / Re: Problem implementing ultrasonic interrupt (new ping library) on: May 20, 2014, 09:09:47 am
I've had some help with the coding of an ongoing project (see previous my previous posts if you want background) which is now working, since I have tried to develop it to include an ultrasonic (SRF05) but cannot even get it to serial.print distances.
I am trying to use the new ping library and think it could be conflicting with some of the other libraries / code.
There are some other posts on here which discuss using event-driven interrupts within this library but I could not get a clear answer from it.

I have tried accessing the ultrasonic data at different baud rates, to no avail. However, with the same setup (connections) and a simple script the ultrasonic works fine.

Simply put, I am trying to have the ultrasonic cause my robot to stop and reverse when it finds an object in front of it before continuing with the program (object removed).   

Code:
#include <Wire.h>
#include <NewPing.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_PWMServoDriver.h"
#include <SPI.h> 
#include <Pixy.h>

#define TRIGGER_PIN  12  // Arduino pin tied to trigger pin on the ultrasonic sensor.
#define ECHO_PIN     11  // Arduino pin tied to echo pin on the ultrasonic sensor.
#define MAX_DISTANCE 200 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.
NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.

    #define swap(a,b) { \
        int c = (a);    \
        (a) = (b);      \
        (b) = c;        \
    }
   
Pixy pixy;
 
Adafruit_MotorShield AFMS = Adafruit_MotorShield();                 
Adafruit_DCMotor *MotorL = AFMS.getMotor(1);
Adafruit_DCMotor *MotorR = AFMS.getMotor(2);


void setup()
{
  Serial.begin(9600); // Open serial monitor at 115200 baud to see ping results.
   
  AFMS.begin();  // create with the default frequency 1.6KHz
  MotorL->setSpeed(255); // Set the speed to start, from 0 (off) to 255 (max speed)
  MotorL->run(FORWARD);// turn on motor
  MotorL->run(BACKWARD);
  MotorL->run(RELEASE);
 
  MotorR->setSpeed(255); // Set the speed to start, from 0 (off) to 255 (max speed)
  MotorR->run(FORWARD);// turn on motor
  MotorR->run(BACKWARD);
  MotorR->run(RELEASE);
}

void loop()
{
  uint16_t blockCount;
  blockCount = pixy.getBlocks();
  Serial.print(" Blocks : ");
  Serial.print(blockCount);
  Serial.print(" ");
 
  const double minRequiredRatio = 0.8;
  const double maxRequiredRatio = 1.2;
 
  int chosenBlock = -1;
  int chosenSignature = 1;
   
  for (int idx = 0; idx < blockCount; ++idx)
  {
    Block& pixyBlock = pixy.blocks[idx];
   
    if (pixyBlock.signature != chosenSignature)
    {
      continue;
    }
   
    int objectSize = pixyBlock.width * pixyBlock.height;
    double objectRatio = (double)pixyBlock.width / (double)pixyBlock.height;
    Serial.print("Size : ");
    Serial.print(objectSize);
    Serial.print(", ");
    Serial.print("Ratio : ");
    Serial.print(objectRatio);
    Serial.print(" ");
 
  const double squareTolerance = 0.5; // Adjust to suit
    double squareness = fabs(1.0 - objectRatio);
   
    const double minRatio = 0.8; // Adjust to suit
    const double maxRatio = 2.0; // Adjust to suit

    if (objectRatio > minRatio && objectRatio < maxRatio)
     {
      chosenBlock = idx;
      break;
    }
  }
 
  if (chosenBlock < 0)
  {
      Serial.println("Could not find desired object");
      MotorL->run(RELEASE);
      MotorR->run(RELEASE);
     return;
  }

Block& singlePixyBlock = pixy.blocks[chosenBlock];

 int objectX = singlePixyBlock.x;
  int objectY = singlePixyBlock.y;
 
  Serial.print(", X Value : ");
  Serial.print(objectX);
  Serial.print(", Y Value : ");
  Serial.println(objectY);
 
    const int cameraWidth = 320;
  const int cameraHeight = 200;
  const int centreX = cameraWidth / 2;
  const int centreY = cameraHeight / 2;
 
   const int idealDistanceSize = 5000; // Adjust to suit
  const int idealDistanceTolerance = idealDistanceSize / 10; // Adjust to suit
 
  int objectSize = singlePixyBlock.width * singlePixyBlock.height;
 
  const int maxSpeed = 255;
  const int slowestSpeed = maxSpeed - 128; // Adjust to suit
  const int distLimit = 10; //Limit for obstacles (in cm)
  int dist = sonar.ping_cm();
 
  int centreOffset = objectX - centreX;
  int speedOffset = ((double)centreOffset / (double)centreX) * (double)(maxSpeed - slowestSpeed);
 
  int speedLeft = slowestSpeed - speedOffset;
  int speedRight = slowestSpeed + speedOffset; 

 int motorDirection = RELEASE;
  Serial.print("objectSize: ");
  Serial.print(objectSize);
 
  if (dist<distLimit)
  {
    motorDirection = BACKWARD;
    Serial.print("Ping: ");
    Serial.print(dist); // Convert ping time to distance in cm and print result (0 = outside set distance range)
    Serial.println("cm ");
  }
 
  if (objectSize < (idealDistanceSize - idealDistanceTolerance))
  {
    motorDirection = FORWARD;
    Serial.print(" FORWARD ");
  }
  else if (objectSize > (idealDistanceSize + idealDistanceTolerance))
  {
    swap(speedLeft, speedRight);
    motorDirection = BACKWARD;
    Serial.print(" BACKWARD ");
  }
  else
  {
    Serial.print(" RELEASE ");
  }


  MotorL->setSpeed(speedLeft);
  Serial.print(" MotorL: ");
  Serial.print(speedLeft);
 

  MotorR->setSpeed(speedRight);
  Serial.print(" MotorR: ");
  Serial.print(speedRight);
 
  MotorL->run(motorDirection);
  MotorR->run(motorDirection);
 
}

I would agree with everyone else here.  There's a LOT you could do better with that code.  I sent you an email reply that fixes most of your sketch.  But, I'd like to post here that it sounds like there's a conflict with a timer.  One of the pins you're using with the ultrasonic sensor could be used as a timer for the motor or camera sensor.  So, try using two pins that don't have a timer attached, like pins 7 & 8.

That's where I would start, clean up your code so it's more understandable and logical, then try using different pins.  Next, adopt an event-driven paradigm instead of the block mode programming style you're currently using.  Doesn't work well for robots.

Tim
36  Using Arduino / Sensors / Re: Auto gain control AGC amplifier for 40 kHz ultrasonic transducer on: May 15, 2014, 01:06:57 pm
Hi, I'm using a 40 kHz ultrasonic transducer to measure the distance of an object, and I need an AGC amplifier IC for my ultrasonic receiver. However I couldn't find any one.

does any one know such an IC device ? The name of the company and the part number of the IC would be also really helpful for me.

Thanks alot

Not to say that you can't make an amplifier to work with the transducer to measure distance.  But, it's a fairly complex and expensive task.  Instead, there's very inexpensive (like $2) sensors that already include the transducers and amplifier so you don't need to re-create anything.  Doing it on your own will be more expensive and probably not as good as a $2 already made sensor.

Tim
37  Using Arduino / Sensors / Re: NewPing Library: HC-SR04, SRF05, SRF06, DYP-ME007, Parallax PING))) - v1.5 on: May 15, 2014, 01:00:50 pm
I used newping libray but It error compiling...

sketch_may15a.cpp.o: In function `__static_initialization_and_destruction_0':
C:\Program Files\Arduino/sketch_may15a.ino:10: undefined reference to `NewPing::NewPing(unsigned char, unsigned char, int)'
C:\Program Files\Arduino/sketch_may15a.ino:10: undefined reference to `NewPing::NewPing(unsigned char, unsigned char, int)'
C:\Program Files\Arduino/sketch_may15a.ino:10: undefined reference to `NewPing::NewPing(unsigned char, unsigned char, int)'
sketch_may15a.cpp.o: In function `loop':
C:\Program Files\Arduino/sketch_may15a.ino:18: undefined reference to `NewPing::ping_cm()'

Please hlep me!

Sounds like you didn't install the library correctly.  Did you decompress it (keeping the directory structure in tact) and put it in your arduino's libraries folder?  I believe there's now also an option in Arduino 1.0.5 to import a library.

Also, you should really always provide your sketch (or mention if you're using an example sketch).  But, these errors are basically saying that it can't find the library AT ALL.  So, you didn't install it correctly (or you just need to close Arduino and open it again).  If you do this and verify the library is installed correctly in your libraries folder like the rest of your libraries and you still have a problem, please indicate the sketch you're using or paste the sketch to your reply.

Tim
38  Using Arduino / Sensors / Re: NewPing Library: HC-SR04, SRF05, SRF06, DYP-ME007, Parallax PING))) - v1.5 on: May 12, 2014, 03:23:46 pm


How many pins are you using?  4?  One pin for triggers on all sensors and 3 pins to get the results from each sensor?  If so, you could just use 3 pins by using the method I describe.

Tim

Please forgive me Tim, I am not understanding, I am using four pins as you have stated but I don't understand how to wire the sensor to only use three pins. This surely would be better because I can add a forth sensor pointing to the rear.

Here is the setup code I am presently using.

Code:
#define LED_STATUS_PIN 13
#define SONAR_NUM     3 // Number or sensors.
#define MAX_DISTANCE 300 // Maximum distance (in cm) to ping.
#define PING_INTERVAL 66 // Milliseconds between sensor pings (29ms is about the min to avoid cross-sensor echo).
...
unsigned long pingTimer[SONAR_NUM]; // Holds the times when the next ping should happen for each sensor.
unsigned int cm[SONAR_NUM];         // Where the ping distances are stored.
byte currentSensor = 0;          // Keeps track of which sensor is active.

NewPing sonar[SONAR_NUM] = {     // Sensor object array.
NewPing(7, 10, MAX_DISTANCE), // Each sensor's trigger pin, echo pin, and max distance to ping.
NewPing(7, 11, MAX_DISTANCE),
NewPing(7,  5, MAX_DISTANCE),
...
for (uint8_t i = 0; i < SONAR_NUM; i++) {       // Loop through all the sensors.
    if (millis() >= pingTimer[i]) {               // Is it this sensor's time to ping?
      pingTimer[i] += PING_INTERVAL * SONAR_NUM;  // Set next time this sensor will be pinged.
      if (i == 0 && currentSensor == SONAR_NUM - 1)
      {
          oneSensorCycle();
          serialCom();
      }          // Sensor ping cycle complete, do something with the results.
      sonar[currentSensor].timer_stop();          // Make sure previous timer is canceled before starting a new ping (insurance).
      currentSensor = i;                          // Sensor being accessed.
      cm[currentSensor] = 999;                      // Make distance zero in case there's no ping echo for this sensor.
      sonar[currentSensor].ping_timer(echoCheck); // Do the ping (processing continues, interrupt will call echoCheck to look for echo).
    }
  }


NewPing supports the ability to use one pin per sensor.  You simply wire a single pin to the trigger and the echo pins on the sensor.  That's it!  In your sketch, you would set the trigger and echo pin as the same pin.  The magic all happens in the library.  It would look something like this:

Code:
NewPing sonar[SONAR_NUM] = {     // Sensor object array.
NewPing(10, 10, MAX_DISTANCE), // Each sensor's trigger pin, echo pin, and max distance to ping.
NewPing(11, 11, MAX_DISTANCE),
NewPing(5,  5, MAX_DISTANCE),
NewPing(7,  7, MAX_DISTANCE)
};

This would ping each device independently, and not all at once like you're doing now.  The way you're doing it could cause bad echo problems.

Tim
39  Using Arduino / Sensors / Re: NewPing Library: HC-SR04, SRF05, SRF06, DYP-ME007, Parallax PING))) - v1.5 on: May 12, 2014, 11:56:36 am

I've never tried using the same trigger pin for multiple sensors nor is the library designed to work this way.  What NewPing would do would be to actually try to initiate a ping three times each sensor.  The sensor would probably ignore this, but there's no guarantee.  Also, I would be concerned with the higher likelihood of echos giving bad results or the pulsing from multiple sensors confusing the sensors.

It would be better (avoiding echos and cross-talk issues) and use fewer pins to just wire a single pin to each sensor's trigger and echo pin.  In other words, you would use 3 pins, each pin going to each sensor's trigger and echo pins.  This would use 3 pins instead of (I assume) the 4 pins you're currently using.  Yes, you would need to ping each sensor individually, but using the non-blocking ping_timer() method your microcontroller could be doing other things while the ping sound is traveling.  I would consider this a more "sound" way to implement 3 sensors.

May I ask, why do you want to ping all three at the same time?  Would it really matter if each ping was 30ms apart?  You could still ping 3 sensors 10 times a second while still "multi-tasking" and doing other processes in your sketch.  Insight on your project and the reasoning would be helpful.

Tim

Thank you for the very quick response Tim,

The primary reason is the limitation of available pins on the Pro-Mini. I have each sensor angled outside of each others echo zone. so there is little or no interferences that I can detect at this point. I may have to upgrade to a Arduino mega before this project is finish.

How many pins are you using?  4?  One pin for triggers on all sensors and 3 pins to get the results from each sensor?  If so, you could just use 3 pins by using the method I describe.

Tim
40  Using Arduino / Sensors / Re: NewPing Library: HC-SR04, SRF05, SRF06, DYP-ME007, Parallax PING))) - v1.5 on: May 12, 2014, 10:49:19 am
First, thank you for this valuable Ping Library,

I am attempting to use the same trigger ping for three HC-SR04 sensor on a Pro-Mini Arduino and so far, things appear to be working fine on the bench. My question is, are there any know issues with using the same trigger pin for two or more sensors?

Thank you.

I've never tried using the same trigger pin for multiple sensors nor is the library designed to work this way.  What NewPing would do would be to actually try to initiate a ping three times each sensor.  The sensor would probably ignore this, but there's no guarantee.  Also, I would be concerned with the higher likelihood of echos giving bad results or the pulsing from multiple sensors confusing the sensors.

It would be better (avoiding echos and cross-talk issues) and use fewer pins to just wire a single pin to each sensor's trigger and echo pin.  In other words, you would use 3 pins, each pin going to each sensor's trigger and echo pins.  This would use 3 pins instead of (I assume) the 4 pins you're currently using.  Yes, you would need to ping each sensor individually, but using the non-blocking ping_timer() method your microcontroller could be doing other things while the ping sound is traveling.  I would consider this a more "sound" way to implement 3 sensors.

May I ask, why do you want to ping all three at the same time?  Would it really matter if each ping was 30ms apart?  You could still ping 3 sensors 10 times a second while still "multi-tasking" and doing other processes in your sketch.  Insight on your project and the reasoning would be helpful.

Tim
41  Using Arduino / Audio / Re: TONE library and External interrupt code collision on: May 06, 2014, 08:58:09 am
Thank for tour answer teckel, one more question, the toneAC library can playa 2 different tones at the sale time, like the library i used?

toneAC plays one tone but uses two SPECIFIC pins to do it.  It does this in a push/pull manor which creates a high sound volume level (and allows you to control the volume).  If you want to play two notes at once, you could probably use toneAC and toneAC2.  I've never tried it but as they use different timers and toneAC2 can use different pins they should work just fine together.  You'll use both timer 1 and timer 2 in the process.  But, to play multiple tones at the same time you probably will used multiple timers.

I also have a tone generator library that doesn't use timers at all, TimerFreeTone.  It runs in blocking mode (doesn't return the the code till the tone is complete).  So, it doesn't work well if you're trying to play music.  But if you just want to play two tones at once and only use one timer, you can use toneAC and TimerFreeTone together as well.

Lots of options, all depending on your needs.

Tim
42  Using Arduino / Sensors / Re: NewPing Library: HC-SR04, SRF05, SRF06, DYP-ME007, Parallax PING))) - v1.5 on: May 05, 2014, 03:00:54 pm
Thanks Tim,

I actually managed it before seeing this post but. I have actually soldered the sensor to the control board as this passes the commands to the motor board. The only problem I seem to be having is that once it detects an object within the desired range the pinging stops as do the measurements to the serial monitor. So when it is supposed to rotate and then carry on doing the same again it just seems to end and then the motors go into a wiggling action?

Thanks again!

Jay.

My guess is that it has something to do with the while loop where you never set a ping variable and never output serial results.  Like usual, it's just doing what you're telling it to do.

I don't know why you have two nestled curly brackets after loop(), either or what that would even do.   Also, you're doing multiple pings and probably shouldn't be.  You're doing one to set the variable cm and print the results, then another ping in the while statement that's actually being used to detect an object.  My guess is that your loop() routine should be more like this:

Code:
void loop() {
  unsigned int cm = sonar.ping_cm(); // Do a ping and set the distance in centimeters to variable cm
  Serial.println(cm); // Output the ping distance in centimeters
  if (cm < 20) { // If an obstacle is less than 20cm away
    Robot.motorsStop(); // stop the motors
    setFace(false); //shows an unhappy face
    Robot.turn(45); // turn to the right and try again
    delay(500); // wait for a moment while it turns (this isn't required if Robot.turn() is a blocking command)
  } else {
    Robot.motorsWrite(155, 155); // if there are no objects in the way, keep moving
    setFace(true); // happy face
    delay(50); // Delay between pings
  }
}

But, I don't ultimately know what you're trying to accomplish, nor have an Arduino Robot to test this with.  But, this code makes more sense than what you had and it compiles.  Also, this has nothing really to do with NewPing.  This is more just simple programming debugging.  You were creating a while loop where it wasn't setting a new distance variable nor sending that value to the serial port, so of course it won't output anything for as long as it's stuck in the while loop.

Tim
43  Using Arduino / Audio / Re: TONE library and External interrupt code collision on: May 05, 2014, 10:37:42 am
Hi guys, good day

Sorry a long tiem without working with arduino, and now i'm stuck on one big problem, i need your help. I'm making this project, with external interrupt to generate super mario bros sound, but it doesn't make any sound. someone can help me??

i see that the interrupt use the uint_8t and the TONE library too, how can i solve it? what i need to change, add or erase  in the code. When i compile the software don't send me any error or warning.

I attach the tone library

If you have a timer conflict, just use a different library that doesn't use the same timer.  The tone library uses timer 2.  So, use a library that uses timer 1 instead.  I created two libraries that do just this:

NewTone - Plug-in replacement for the tone library, uses timer 1, much smaller and faster.
toneAC - Twice as loud, ability to control volume, uses timer 1, must use two specific pins.

I also have a 3rd library that would work that doesn't use any timers at all.  This is useful if you have a project that both uses timer 1 and timer 2 but you still want to play sound.  That library can be found here:

TimerFreeTone - Doesn't use timers at all, but in blocked mode (can't do other things while the tone is being played).

Between these 3, you should find something that works.  All have example sketches that show working examples.  I even have a 4th audio library called toneAC2 that works similar to toneAC but uses timer 2.  That won't work for you, as your conflict is with timer 2.  Yes, I do have a lot of audio libraries smiley-wink

Tim
44  Using Arduino / Sensors / Re: NewPing Library: HC-SR04, SRF05, SRF06, DYP-ME007, Parallax PING))) - v1.5 on: May 05, 2014, 10:12:45 am
Thanks for your help Tim, I have now attached the sensor to D3 and I am able to get readings via serial. Could you or anybody else help me change this code to work with your library:

Code:
#include <ArduinoRobot.h>
#include <Wire.h>
#include <SPI.h>

int sensorPin = M1;  // pin is used by the sensor

void setup() {
  // initialize the Robot, SD card, and display
  Serial.begin(9600);
  Robot.begin();
  Robot.beginTFT();
  Robot.beginSD();
  Robot.displayLogos();

  // draw a face on the LCD screen
  setFace(true);
}

void loop() {
  // If the robot is blocked, turn until free
  while (getDistance() < 40) { // If an obstacle is less than 20cm away
    setFace(false); //shows an unhappy face
    Robot.motorsStop(); // stop the motors
    delay(1000); // wait for a moment
    Robot.turn(90); // turn to the right and try again
    setFace(true); // happy face
  }
  // if there are no objects in the way, keep moving
  Robot.motorsWrite(255, 255);
  delay(100);
}

// return the distance in cm
float getDistance() {
  // read the value from the sensor
  int sensorValue = Robot.analogRead(sensorPin);
  //Convert the sensor input to cm.
  float distance_cm = sensorValue * 1.27;
  return distance_cm;
}

// make a happy or sad face
void setFace(boolean onOff) {
  if (onOff) {
    // if true show a happy face
    Robot.background(0, 0, 255);
    Robot.setCursor(44, 60);
    Robot.stroke(0, 255, 0);
    Robot.setTextSize(4);
    Robot.print(":)");
  } else {
    // if false show an upset face
    Robot.background(255, 0, 0);
    Robot.setCursor(44, 60);
    Robot.stroke(0, 255, 0);
    Robot.setTextSize(4);
    Robot.print("X(");
  }
}

This is meant to be used with an analog sensor like a Maxbotix EZ10.

Thanks for your help so far!
Jay.

P.S. All of the LCD stuff isn't important, it is just the sensor working with the motors I need working. Thanks again!

To use NewPing, all you would do is include the library, setup the constructor, and send a ping.  The basic NewPing example shows how to do this.

But, basically you would include the library like this:
Code:
#include <ArduinoRobot.h>

Setup the constructor:
Code:
NewPing sonar(sensorPin, sensorPin, 100);

And initiate a ping and get the result, which in your code would look something like this:
Code:
  while (sonar.ping_cm() < 40) { // If an obstacle is less than 40cm away

However, the sensor would need to be connected to the motor board, not the control board.  I don't have an Arduino Robot to be able to tell you how to write your code.  My guess is that you need two sketches, one for the control board and one for the motor board, and your sketch would need to communicate between the two boards to accomplish this.  I have no first-hand usage of the Arduino Robot so there's no way for me to write working code for you.  I tried, and it wouldn't compile.

I do know that you would need to connect the ultrasonic senor to one of the pins on the motor board (TK1-TK4).  Other than that, you're on your own to write your own code.  It should be VERY easy if you know how to program Arduino sketches and have any experience with using the Arduino Robot.  If this is your first sketch, maybe you should start with something really basic first.

Tim
45  Using Arduino / Sensors / Re: NewPing Library: HC-SR04, SRF05, SRF06, DYP-ME007, Parallax PING))) - v1.5 on: May 02, 2014, 09:25:38 am
Do you just name the same digital pin twice when you want to use the same pin for trigger and echo?  That simple?

Yup, that simple.

Tim
Pages: 1 2 [3] 4 5 ... 35