Show Posts
Pages: 1 2 [3] 4 5 ... 206
31  Using Arduino / Motors, Mechanics, and Power / Re: Linear motion design on: September 06, 2014, 11:55:44 pm
I'd recommend a turkish midget under the desk.
32  Using Arduino / Sensors / Re: Help Understanding ITG3205 Temperature Offset on: September 06, 2014, 05:14:00 am
I am not convinced that temperature is your problem.  The gyro drift changes all the time,  you have to deal with that by other means anyway.
33  Using Arduino / Programming Questions / Re: Balance robot PID understanding on: September 04, 2014, 08:03:47 pm
Code:
correction = pid();
                drive(correction, correction);

This is the part of the main loop( )   which calls the pid( ) and drive( ) functions.

34  Using Arduino / Programming Questions / Re: Still stuck with CLASS, "Member functions" and that sort of thing. on: September 03, 2014, 03:30:22 pm
Quote
So that means I have to copy the RTClib.h and .cpp files into that directory first.

No you don't.
35  Using Arduino / Programming Questions / Re: Help in the code syntax on: September 03, 2014, 03:24:27 pm
The macros and text strings require the line continuation marker ( backslash ),   because in those specific contexts,    the "white space" in the file ( including line breaks ),  does matter.

And operators and special symbols consisting of two or more characters,    such as ==   or   //   or !=       can't be broken apart either,  right.

And the names of variables and functions  and any language keywords can't be broken in the middle, either.
36  Using Arduino / Programming Questions / Re: why error msg "Some files are marked \"read-only\"... on: September 03, 2014, 03:20:42 pm
If you changed the status of the files in your folder,   and still cannot save the file,     and you didn't close the IDE while you were doing that,    that's why the problem seems to not be solved.

The IDE will notice that the file was "read-only"  when you openned it and started editing,     and it remembers that,    and won't know that you have gone to the folder  and changed it.
37  Using Arduino / Programming Questions / Re: Virtual Wire Library questions on: September 03, 2014, 03:16:49 pm
sprintf( )  is NOT an alternative method to using atoi( )

sprintf( )  does the OPPOSITE of what atoi( ) does.
38  Using Arduino / Programming Questions / Re: Virtual Wire Library questions on: September 03, 2014, 03:14:25 pm
Quote
if it doesn't work, I'm sure I hear about it
Probably, yes.

Quote
If you do the whole string atoi(buf), then it will convert everything, even the commas and period into one integer. 

Wrong again.

atoi(buf) will look through buf,   and try to find one or more characters which can be interpreted as an integer,     and as soon as it comes to a character which cannot be part of an integer,   it will stop looking,   and return what it has.
39  Using Arduino / Programming Questions / Re: Virtual Wire Library questions on: September 03, 2014, 03:06:02 pm
Quote
sprintf(Array, "%d,%d,%d.",X,Y,Z); So looking at its syntax, if I just needed to store and place two seperate sensor values in the array it'd go sprintf(Array, "%d,%d.",X,Y,);  correct?

the point that you missed here,   and hazardmind did a poor job of explaining,   it that you are not putting the two sensor values X and Y into an array ( of sensor values ).

You are effectively "printing" them into an array of text.

So if your ( integer ) sensor values are     12  and 27,   if you were putting them into an array,   you would have something equivalent to
Code:
   int Array[2] = { 12, 27 };

But that is not what sprintf( ) does.    sprintf( ) does the same thing as printf,   except the output goes into a char buffer instead of your output/display device.

So,   after you call sprintf,   your result looks like this:
Code:
char Array[20] ;
sprintf( Array, "%d,%d,%d", X,Y,Z } ;

// is equivalent to

char Array[] = { '1', '2', ',' , '2', '7', ',' , '3', '4', ...  };

//   The elements in Array[] here are individual ascii characters representing the text representation
//   of your sensor value numbers.
40  Using Arduino / Programming Questions / Re: Virtual Wire Library questions on: September 03, 2014, 02:56:08 pm
Quote
But ive never seen

sprintf(Array, "%d,%d,%d.",X,Y,Z);

and im guessing

Don't guess.   Look it up.  Is google broken in your country ?
41  Using Arduino / Programming Questions / Re: Low performance using readBytes() on: September 03, 2014, 02:47:52 pm
The code you have shown there,   does not require any useful feature of the String class.

If all you want to do,  is check whether the first character that you got is an 'r',  then

Code:
if ( buffer[0] == 'r' )
{     
     // you got an r,  do something
}

42  Using Arduino / Programming Questions / Re: Low performance using readBytes() on: September 03, 2014, 02:44:25 pm
If you read 10 bytes and then assign a value to  buffer[10],   then you might have made an error.  How large is buffer[] ?
43  Using Arduino / Programming Questions / Re: if command question on: September 03, 2014, 02:40:06 pm
Quote
Working perfectly. One more project is done.

I very much doubt it.
44  Using Arduino / Programming Questions / Re: if command question on: September 03, 2014, 02:36:21 pm
Code:
digitalRead(exs);

This isn't going to work.     If you want to read the state of a digital input pin,   you need something more like

Code:
exs = digitalRead( pin_number );
if ( exs == 1 )
{   
    // assign something else here
}

45  Using Arduino / Programming Questions / Re: ir sketch error: too few arguments to function 'void pulseIR(long int)' on: September 03, 2014, 02:31:25 pm
Code:
sketch_sep03c:132: error: at this point in file

In case you hadn't realised,  this is telling you that the error is at line 132 in the source code file.

The place where the compiler realises that there is an error,  isn't always exactly where the error really is,
but it is a good place to start looking.

Pages: 1 2 [3] 4 5 ... 206