Go Down

Topic: somebody can tell the mean. (Read 413 times) previous topic - next topic

mjm2246

int ultraSoundSignalPins[] = {0,1}; // 2 Ultrasound signal pins
int ultraSoundTriggerPin = 6;        // output pin to start Ultrasound signals
int pwm_a = 3;
int pwm_b = 11;
int dir_a = 12;
int dir_b = 13;
unsigned char analogPin = 0;

void setup() {
   
   Serial.begin(9600);
   for(int i=0; i < 2; i++) {
   pinMode(ultraSoundSignalPins, INPUT); // Switch signalpin to input
   }
   pinMode(ultraSoundTriggerPin, OUTPUT); // set this pin to output
  //give the sensors time to boot up
   delay(250);
   // send RX pin high to signal to chain to ping
   digitalWrite(ultraSoundTriggerPin, HIGH);
   delayMicroseconds(30);
   digitalWrite(ultraSoundTriggerPin, LOW);
   pinMode(ultraSoundTriggerPin, INPUT); // electrically disconnects the pin
   delay(50);








this i do not unstander ?
what it means.


Serial.begin(9600);
   for(int i=0; i < 2; i++) {
   pinMode(ultraSoundSignalPins, INPUT); // Switch signalpin to input
   }
   pinMode(ultraSoundTriggerPin, OUTPUT); // set this pin to output
  //give the sensors time to boot up
   delay(250);
   // send RX pin high to signal to chain to ping
   digitalWrite(ultraSoundTriggerPin, HIGH);
   delayMicroseconds(30);
   digitalWrite(ultraSoundTriggerPin, LOW);
   pinMode(ultraSoundTriggerPin, INPUT); // electrically disconnects the pin
   delay(50);

Grumpy_Mike

Two things
1) go back to that post by hitting modify, select the code, hit the # icon and save.
2) Can you point out what you don't understand in the code. The Serial.begin just under the arrow is a mistake, it should be removed.

TeslaIaint

What are you asking? What are you trying to accomplish with the code? It looks like you are chaining two Maxbotix ultrasonic sensors. Where is your loop? \http://www.maxbotix.com/downloads.htm There you'll find links to datasheets, quick start guides, etc. If you're more specific with your question, you may get a more specific answer.

Go Up