Show Posts
Pages: 1 ... 2247 2248 [2249] 2250 2251 ... 3341
33721  Using Arduino / Programming Questions / Re: Multidimensional Arrays with Pointers on: November 29, 2011, 08:23:20 am
Quote
Which are arrays, which by definition in cpp are pointers.
But they are NOT arrays of pointers. The type of those arrays is char, not char *. You must make them char *.
33722  Using Arduino / Interfacing w/ Software on the Computer / Re: how to make arduino type words as keyboard? on: November 29, 2011, 07:28:48 am
We're not going to do your project for you, so quit posting the same thing over and over.

Learn to spell, too.
33723  Using Arduino / Project Guidance / Re: electromagnets and messages, and other stuff on: November 29, 2011, 07:18:25 am
Quote
how can i send signal to the computer
What signal? The PC is not very good at receiving smoke signals.

Quote
then display a message?
On what?

Quote
can i do that using a batch or vbs program?
I don't think a batch program interactively displaying messages will work very well. A VB application would be a better choice.

33724  Using Arduino / Project Guidance / Re: GP-2106 GPS on: November 29, 2011, 07:14:39 am
Quote
I don't know how to convert to 1.8vdc
You don't know how to convert what to 1.8V? An umbrella? A frog? Perhaps an old canoe that sank?

Quote
and the datasheet says I need two capacitors.
Well, I guess you are out of luck then.
33725  Using Arduino / Programming Questions / Re: a long loop on: November 29, 2011, 06:50:36 am
Quote
its a long void with morse-code
"It" is a function, not a void. How would you describe "it" if its return type was int?

Quote
Is their any way to run a program ( morse() p.e. )and meanwhile measures all the other voltages.
Certainly. Get rid of all delay() calls.

That might not be practical in all cases, but certainly you can put the voltage test code in a function, and call it often from the morse() function. Say, every 10 characters. Calling morse() again from within morse() is probably not a good idea, though.
33726  Using Arduino / Networking, Protocols, and Devices / Re: Does Zigbee have power saving algoritms??? . on: November 29, 2011, 06:42:46 am
XBees can be put to sleep. Digi.com has all the documentation for all the XBees. Specifically how to put one to sleep/wake one up depends on which XBee you have.
33727  Topics / Robotics / Re: Lottie Lemon Release Date on: November 29, 2011, 05:58:06 am
Quote
Has there been any update on the Lottie Lemon release date?
What are you talking about?
33728  Using Arduino / Programming Questions / Re: To rotate EC motor one revolution and stop it on: November 29, 2011, 05:49:19 am
Quote
Thank you for your reply but can you elaborate bit more on it? I think I am not understanding this correctly
First, you probably need to describe what you are doing. Trying to turn a 12000 RPM motor exactly one revolution just isn't possible.
33729  Using Arduino / Programming Questions / Re: Multidimensional Arrays with Pointers on: November 29, 2011, 05:47:19 am
Quote
It really didnt like that lol
I'm getting tired of trying to tell you that the variable you are trying to pass to a function, the call to that function, the function definition, AND the function code ALL need to match.

You can't just change the function definition and expect it to work.

You changed the definition of parse2, but not the type of the argument you are trying to pass to it. The compiler told you that. That's what the first message is saying.

You changed the definition of parseLhsRhs2, but not the type of the argument you are trying to pass to it. The compiler told you that. That's what the second message is saying.
33730  Using Arduino / Programming Questions / Re: Example of interrupt-based version of reading serial port on: November 29, 2011, 05:42:33 am
Quote
The documentation of which says, for Serial.available() (emphasis mine):
Well, we all know how much fun it is to maintain documentation, and keep it current, for every variation of the Arduino, without adding so much material that newbies get confused.

The definitive source of information is NOT the documentation. It is the source code.
33731  Using Arduino / Networking, Protocols, and Devices / Re: Control Arduino UNO from PC with XBee(Updated). on: November 28, 2011, 07:40:10 pm
Quote
I entered data in Serial monitor.
The Serial Monitor doesn't understand numbers. When you type 180, and hit send, the Arduino gets '1', '8', '0', '<cr>', and '<lf>' (if you have the Append CR/LF option selected).

You need to collect all the data for the packet, with \n as the end of packet marker, then convert the string to an int.

Code:
#define EOP '\n'

bool ended = false;

char inData[80];
byte index;

void setup()
{
   Serial.begin(57600);
   // Other stuff...
}

void loop()
{
  // Read all serial data available, as fast as possible
  while(Serial.available() > 0)
  {
    char inChar = Serial.read();
    if(inChar == EOP)
    {
       ended = true;
       break;
    }
    else
    {
      if(index < 79)
      {
        inData[index] = inChar;
        index++;
        inData[index] = '\0';
      }
    }
  }

  // We are here either because all pending serial
  // data has been read OR because an end of
  // packet marker arrived. Which is it?
  if(ended)
  {
    // The end of packet marker arrived. Process the packet

    // Reset for the next packet
    ended = false;
    index = 0;
    inData[index] = '\0';
  }
}
33732  Using Arduino / Storage / Re: reading variable date from sdcard on: November 28, 2011, 07:33:07 pm
Quote
Is it possible to read data from a sd card and get the desired results I'm looking for, and if yes, please point me towards an example program and I'll move forward with this design change.
Sure it is. Look at the SD library. Examples included.
33733  Using Arduino / Programming Questions / Re: Help with starting/stopping a sketch on: November 28, 2011, 07:27:36 pm
Quote
Would the proper way to apply that logic be
Yes.
33734  Using Arduino / Programming Questions / Re: Using Keyboard to control a Motorshield on: November 28, 2011, 07:15:58 pm
Are you not reading the posts here, and the compiler messages. Earlier, you were told to put this:
Code:
AF_DCMotor motor1(1, MOTOR12_64KHZ); // create motor #1, 64KHz pwm
AF_DCMotor motor2(2, MOTOR12_64KHZ); // create motor #2, 64KHz pwm
AF_DCMotor motor3(3, MOTOR12_1KHZ); // create motor #3,1KHz pwm (Res)
AF_DCMotor motor4(4, MOTOR12_1KHZ); // create motor #4, 1KHz pwm (Res)
Which you did, but you didn't change the places where motor was, to motor1, motor2, etc.

Then when it was pointed out that you needed to, you want back and changed these 4 lines. Why?

These 4 lines are correct. The instances later need to be motor1, motor2, etc.
33735  Using Arduino / Programming Questions / Re: Multidimensional Arrays with Pointers on: November 28, 2011, 07:06:11 pm
In parseRhSLhs2(), aCommands[n][n] is assigned a pointer. That means that aCommands needs to be a char *** object, not a char ** object.

This means that you need to pass an array of pointers to parseRhsLhs2(). So, in sortOut(),
char *aCommands_[MAXCOMMANDS};
char *aCommands2_[MAXCOMMANDS][2];

Get rid of the pCommands_ and pCommands2_ variables. They are not needed.

In Input::parse2(), the third argument should be of type char **, not char *, and:
Code:
    aCommands[filed_] = strdup(pStr_);

In Input::parseLhsRhs2(), the third argument should be of type char ***, not char **.
Pages: 1 ... 2247 2248 [2249] 2250 2251 ... 3341