Recent Posts

Pages: 1 ... 8 9 [10]
91
General Electronics / Re: Is plumbing copper, refrig...
Last post by westfw - Today at 07:36 am
Quote
inner diameter of 8 and 6 gauge wire.
I would be very hesitant to re-purpose copper plumbing for use on a crimped connection.  There's a bunch of "black magic" to crimps, and I'd worry that the plumbing would not have the right ductility or hardness (or something) that could lead to loosening and dangerous conditions (for any circuit that needs 6 to 8g wire to handle!)
92
I've finally solved the code for my project!

Code: [Select]


 
     Uno           WAV Trigger
     ===           ===========
     GND  <------> GND
     Pin9 <------> RX


    The circuit for the 3 pin PING:
    - +V connection of the PING))) attached to +5V
    - GND connection of the PING))) attached to ground
    - SIG connection of the PING))) attached to digital pin 7 */

// ****************************************************************************

#include <AltSoftSerial.h>    // Arduino build environment requires this
#include <wavTrigger.h>

// this constant won't change.  It's the pin number
// of the sensor's output:
const int pingPin = 7;

wavTrigger wTrig;             // Our WAV Trigger object


// ****************************************************************************

void setup() {
 
  // Serial monitor
  Serial.begin(9600);

  // If the Arduino is powering the WAV Trigger, we should wait for the WAV
  //  Trigger to finish reset before trying to send commands.
  delay(1000);

  // WAV Trigger startup at 57600
  wTrig.start();
  delay(10);
 
  // Send a stop-all command and reset the sample-rate offset, in case we have
  //  reset while the WAV Trigger was already playing.
  wTrig.stopAllTracks();
  wTrig.samplerateOffset(0); 
}

// ****************************************************************************

void loop() {

  // establish variables for duration of the ping, and the distance result
  // in inches and centimeters:
  long duration, inches, cm;

  // The PING))) is triggered by a HIGH pulse of 2 or more microseconds.
  // Give a short LOW pulse beforehand to ensure a clean HIGH pulse:
  pinMode(pingPin, OUTPUT);
  digitalWrite(pingPin, LOW);
  delayMicroseconds(2);
  digitalWrite(pingPin, HIGH);
  delayMicroseconds(5);
  digitalWrite(pingPin, LOW);

  // The same pin is used to read the signal from the PING))): a HIGH pulse
  // whose duration is the time (in microseconds) from the sending of the ping
  // to the reception of its echo off of an object.
  pinMode(pingPin, INPUT);
  duration = pulseIn(pingPin, HIGH);

  // convert the time into a distance
  inches = microsecondsToInches(duration);
  cm = microsecondsToCentimeters(duration);



   if (cm >= 10 && cm <= 30) {
   wTrig.trackPlayPoly(16);               // Start Track 16 poly
   delay(10000);

   
   else { 
   wTrig.trackPlayPoly(2);               // Play 1st note
   delay(1000);
   wTrig.trackPlayPoly(3);               // Play 2nd note
   delay(1000);
   wTrig.trackPlayPoly(4);               // Play 3rd note
   delay(1000); 
   
  }

}

long microsecondsToInches(long microseconds) {
  // According to Parallax's datasheet for the PING))), there are 73.746
  // microseconds per inch (i.e. sound travels at 1130 feet per second).
  // This gives the distance travelled by the ping, outbound and return,
  // so we divide by 2 to get the distance of the obstacle.
  // See: http://www.parallax.com/dl/docs/prod/acc/28015-PING-v1.3.pdf
  return microseconds / 74 / 2;
}

long microsecondsToCentimeters(long microseconds) {
  // The speed of sound is 340 m/s or 29 microseconds per centimeter.
  // The ping travels out and back, so to find the distance of the object we
  // take half of the distance travelled.
  return microseconds / 29 / 2;
}


         
           
   
 

93
Hardware / Re: Alimentacion de varios ard...
Last post by el_pedriyo - Today at 07:33 am
Si, la del dibujo es una de las opciones que dije pero representada, pero en realidad cuando el pincho del arduino no esta conectado a gnd es decir a 0v, en realidad que esta leyendo? Basura? Es decir, una seƱal residual o algo asi y por eso ese metodo esta funcionando?
94
Programming Questions / Re: Array Declaration Question
Last post by Delta_G - Today at 07:33 am
Each one of those strings of characters in quotes represents an array of char type variables.  So an array of those would be an array of arrays.  Using an array of strings this way can be wasteful though since the array has to be "rectangular".  Each thing in the array has to be the same size.  "Send" takes 5 characters (4 letters plus terminating null) so when you get to "1" you're using 5 chars to hold 1 char of information. 
95
Project Guidance / Re: Twitching servos in my pro...
Last post by TomGeorge - Today at 07:32 am
Hi,
Is this thread associated with this thread?

https://forum.arduino.cc/index.php?topic=500040.0


Tom... :)
96
Sensors / Re: sensor for accurately meas...
Last post by kenwood120s - Today at 07:32 am
Quote
measure small tensile forces (less than a couple grams). 
Grams are mass, not force ;)

97
Bar Sport / Re: Computer says nuke the USA...
Last post by Coding Badly - Today at 07:30 am

I am certainly in favour of toasting Mr. Petrov.  At the time I lived within certain death distance of the #3 strategic target.  He very likely he saved my life.

98
Robotics / CUTSIE WHUN - I want to BREAK ...
Last post by Pigeon-Kicker - Today at 07:29 am
CUTSIE WHUN - I want to BREAK YOU - Durability test Video

The Cutsie Whun project is a two wheeled balancing Arduino robot.

And yes, I think that he survived the destruction relatively well.  Minus one Outboard Motor gear set.
LOLZ

He is very fast, compact, and tough.

Enjoy the video. and you can visit my Google+ community any time.
99
On the subject of the IR leds, I may have missed it, but how is OP producing the 38kHz carrier?

100
General Electronics / Re: Problem of using an array ...
Last post by Wawa - Today at 07:26 am
Problem is that IR LEDs are not producing a "laser beam" like in the picture, but light in a cone shape.
This could only work if you matrix them (turn one set on at the time).
Leo..
Pages: 1 ... 8 9 [10]