Show Posts
Pages: [1] 2 3 ... 46
1  Forum 2005-2010 (read only) / Troubleshooting / Re: How do I impliment Differential Drive on: September 16, 2010, 02:29:05 am
I'm assuming they're mistakes, but couple things I noticed:

You don't have power going to the regulated 5V input or pin 8. I just use the 5v from the Arduino.

Also, the bottom motor isn't connect correctly, the green wire is on one of the INPUTS, and not the motor output.


Also one thing you could try doing is changing the pins that you're driving HIGH/LOW.


http://luckylarry.co.uk/arduino-projects/control-a-dc-motor-with-arduino-and-l293d-chip/
2  Forum 2005-2010 (read only) / Troubleshooting / Re: PING))) LCD on: October 06, 2009, 02:29:10 am
Just use the same commands you use for writing to the LCD...
lcd.setCursor(0, 0);
lcd.print("inches:")
lcd.print(inches);
lcd.setCursor(0, 1);
lcd.print("centimeters:");
lcd.print(cm);

Keep in mind you need to use setCursor if you want them both to display.. and add ("inches") and such, I suggest you look into the liquid crystal examples..
http://arduino.cc/en/Tutorial/HomePage
On the right side.
3  Forum 2005-2010 (read only) / Troubleshooting / Re: PING))) LCD on: October 06, 2009, 02:19:14 am
So I'm confused, still.

Are you not sure how to use the LCD? Is the PING sensor working? and is the LCD working?

But the code you posted, is exactly the same as the code I posted, but it takes away the comments.. and adds initializing the LiquidCrystal library.. and it IS for the Parallax Ping))) sensor.

So.. does it work when you use the serial monitor?

The code you have only STARTS the LCD, doesn't actually use any commands to print anything to it.
4  Forum 2005-2010 (read only) / Troubleshooting / Re: PING))) LCD on: October 06, 2009, 02:11:12 am
I thought ping sensors used 1 pin for input and output, I only see input here.

(btw, use the Code key (#) above, when you're posting code, makes it much easier to read:))

The code looks okay for the most part, haven't used the 4bitLCD, usually use liquid crystal, but something I'm curious about
Code:
// PRINT USING INCHES
   lcd.printIn(itoa(val, buf, 10));
   lcd.printIn(" in / ");
   // PRINT USING CENTIMETERS
   lcd.printIn(itoa(val * 2.54, buf, 10));
   lcd.printIn(" cm");
Not sure if the first one is really inches, but if so.. you're saying that a CM is equal to 2.54 times the size of an inch. (Maybe your comments are backwards?:X)


But you never stated WHAT your problems are...
are you receiving some data, but it doesn't make sense?
are you not receiving any data?
which ping sensor is it? Some have 2 pins for the input and output, but others just use one. Both can work with the Arduino, but have to adjust your code.. and the code you're using suggests, uhh.. that your ping sensor is working all the time.

Take a look at the ping example with the IDE. You first need to put the output pin HIGH, then read the input. I'm not seeing where you put the sensor high for the reading. Your code would *probably* work with some analog sensor, such as an LDR, potentiometer, sharp sensor.. etc.

Code:
/* Ping))) Sensor
  
   This sketch reads a PING))) ultrasonic rangefinder and returns the
   distance to the closest object in range. To do this, it sends a pulse
   to the sensor to initiate a reading, then listens for a pulse
   to return.  The length of the returning pulse is proportional to
   the distance of the object from the sensor.
    
   The circuit:
      * +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

   http://www.arduino.cc/en/Tutorial/Ping
  
   created 3 Nov 2008
   by David A. Mellis
   modified 30 Jun 2009
   by Tom Igoe

 */

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

void setup() {
  // initialize serial communication:
  Serial.begin(9600);
}

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);
  
  Serial.print(inches);
  Serial.print("in, ");
  Serial.print(cm);
  Serial.print("cm");
  Serial.println();
  
  delay(100);
}

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;
}
Notice how the code puts the pin to an OUTPUT first, then pings, then puts it back into an INPUT.
5  Forum 2005-2010 (read only) / Troubleshooting / Re: PING))) LCD on: October 06, 2009, 01:34:10 am
Well, let's start off by seeing your current code..

You should be able to combine the two examples, LiquidCrystal and the Ping sensor fairly easily.
6  Forum 2005-2010 (read only) / Troubleshooting / Re: why is my programmer not responding? on: September 06, 2010, 04:32:26 pm
Where did you solder the header pins onto?

Have you tried resetting the board manually when trying to upload? Push the upload button in the Program, hold reset, then wait for the RX/TX to blink then let go, it blinks only 3 times so be quick! (if it works:))

Also, might sound crazy but did you select the correct Serial port and board?  Each Arduino board (the 232 chip actually) uses a different COM number.

7  Forum 2005-2010 (read only) / Troubleshooting / Re: need help with led cube on: September 03, 2010, 03:51:27 am


Good video describing on how to wire one up, from Makezine.
8  Forum 2005-2010 (read only) / Troubleshooting / Re: LCD 4x20 issue on line 3/4 with over 16 characters on: November 14, 2009, 09:58:09 pm
Indeed, I still don't understand why it's "normal" but there's alot I don't understand!  smiley-grin Was kind of a pointer, so if he encounters the same problem, he knows he's not the only one!  smiley-wink
9  Forum 2005-2010 (read only) / Troubleshooting / Re: LCD 4x20 issue on line 3/4 with over 16 characters on: November 14, 2009, 07:49:42 pm
Did you set the LCD Correctly?

lcd.begin(20, 4);

I haven't been able to get the same results, all though, if I do continue to print on line 1, instead of going down to line 2, it skips to line 3. Then after line 3 is full, it goes back to line 2, fills up line two, then skips down to line 4 to fill up line four...
Then heads back to line 1 to start filling that again. setCursor works fine for all lines.. and columns.

10  Forum 2005-2010 (read only) / Troubleshooting / Re: 'Wire' was not declared in this scope on: December 28, 2009, 06:02:47 am
There was a post about this previously.. it has something to do with how the Arduino IDE treats header files.

To solve the problem, you should be able to add the #include <Wire.h> inside the sketch you're trying to use. Somebody can explain how the headers work better, but I know the Arduino IDE has it's limitations.
11  Forum 2005-2010 (read only) / Troubleshooting / Re: setCursor example in Arduino "learning" on: December 04, 2009, 04:51:11 am
Really? You make a post just to point out a typo?


......
 :-?

Quote
In the funny world of lcd displays, the (0,0) is top left, which is quite different from conventional x,y co-ordinates in the math books. I think this is confusing sometimes.
There are alot of little things like this to get used to with microcontrollers smiley-grin  ... such as counting starting at 0, I made many a mistake when first starting out.. always start counting at 1 and mess things up. smiley-razz

And I got an LCD that has 131x131 pixels... and it's the same way! Makes for a hassle when you're trying to remember exactly where that pixel would be on the screen. smiley-razz
12  Forum 2005-2010 (read only) / Troubleshooting / Re: Functions in Arrays on: December 18, 2009, 12:26:04 am
Quote
It's difficult for me to tell what you're trying to accomplish.  Please describe what problem you're trying to solve.
lol:
Quote
Can I store function calls in an array?


I'm not sure you'll be able to store Functions into arrays.. can't say I've tried.. but have you thought about just using ASCII values 'a' to 'z' and then just use a Case statement for the function?

For example:
Quote
char myFuncs[] = {
  'a','b','c'};  // etc etc.. up until z

void myFunction(char Command)
{
  switch(Command)
  {
  case 'a':
    // do something here
    break;
  case 'b':
    // do something else here!~
    break;
  case 'c':
    // do another something here
    break;
  }
}

void setup()
{
}

void loop()
{
  myFunction(myFuncs[0]);
}

13  Forum 2005-2010 (read only) / Troubleshooting / Re: NMEA Library on: December 11, 2009, 06:19:09 am
I haven't tried the library you've provided, but I have used TinyGPS with results, maybe you will to?
http://arduiniana.org/libraries/TinyGPS
14  Forum 2005-2010 (read only) / Troubleshooting / Re: problem with ATmega328p on: November 22, 2009, 05:32:39 am
I got this error before... but I can't recall what happened :/

0016? Have you tried updating to 0017?  Also, have you tried more than one sketch? Rather than just more than one board?

15  Forum 2005-2010 (read only) / Troubleshooting / Re: GPRS Connection on: November 16, 2009, 07:08:00 pm
http://arduiniana.org/libraries/TinyGPS/

That's a library for using GPS on Arduino, it uses NewSoftSerial I believe so you also need to download that from the same website.

But as far as web-logging goes.. haven't experimented much there so you'll have to wait for someone else. smiley
Pages: [1] 2 3 ... 46