Show Posts
Pages: 1 ... 2119 2120 [2121] 2122 2123 ... 3234
31801  Using Arduino / Networking, Protocols, and Devices / Re: gpsbee seeduino stalker on: December 07, 2011, 09:44:04 am
the code succesfully creates the csv file but no gps data seems to be written
You seem to be reading from Serial to get the GPS data, and writing to Serial for debugging. That doesn't seem right, to me.
31802  Using Arduino / Programming Questions / Re: Newbe question about programming on: December 07, 2011, 08:19:59 am
The most stupid programs in the world can compile.
Win7 is a good example.
31803  Using Arduino / Storage / Re: How to open correct file in a list of files using "name + number" in filename on: December 07, 2011, 07:45:06 am
int jobNumber =14;
char fileName[12];
sprintf(fileName, "ajob%d.txt", jobNumber);

will result in fileName containing "ajob14.txt", which can be used as an argument to
31804  Using Arduino / Storage / Re: Replace a line in a txt file using SD [SOLVED + WORKAROUND] on: December 07, 2011, 07:42:17 am
Only the number of columns are fixed, like in a database, but I don't think someone has implemented a simply database lib for SD yet.
What is creating the data in the file? If the number of columns is fixed, it implies that the data type in each column is the same. If that is the case, then proper formatting of the data in the column would ensure that the column width was consistent, resulting in a consistent record length.
31805  Using Arduino / Programming Questions / Re: Newbe question about programming on: December 07, 2011, 07:12:30 am
I am sorry Mike, I thought this part of the forum was for asking questions?
It is. But there are some things that are better learned by trying. Change the value from 255 to some other value, and observe the results. That will mean a lot more than us telling you what will happen.
31806  Using Arduino / Storage / Re: Replace a line in a txt file using SD [SOLVED + WORKAROUND] on: December 07, 2011, 07:00:11 am
One other possibility would be to change from variable record lengths to fixed record lengths, if that is possible for you. If each record was always the same length, you could open the file for read and write, locate the appropriate record, and write a new record. You can't do that with variable length record files.
31807  Using Arduino / Storage / Re: Replace a line in a txt file using SD on: December 07, 2011, 06:35:27 am
If you want to replace a line in a file, you need to open that file for read, and another file for write. Read each line from the original file. If it is not the line to replace, write that line to the temporary file. If it is, write the new line to the temporary file, instead.

When every record has been copied to the temporary file, close both files. Delete the original file, and rename the temporary file.
31808  Using Arduino / Networking, Protocols, and Devices / Re: XBee Pro configuration help (Error setting MY) on: December 07, 2011, 05:46:49 am
When I attempt to set the MY via:
Where? How?

I get an ERROR.
Which one?
31809  Using Arduino / Interfacing w/ Software on the Computer / Re: Processing signals sent from Arduino to Game Boy Advance Emulator. on: December 07, 2011, 05:39:38 am
I am guessing that I would need to create some sort of windows driver.
I think that if you had a clue how to do this, you wouldn't need to ask.

What is this "Visual Boy Advance emulator" that you want to control? Perhaps it has a way of reading data from a serial port, already.
31810  Using Arduino / Interfacing w/ Software on the Computer / Re: Help with choosing a protocol* for sending numbers to arduino on: December 07, 2011, 05:36:11 am
The PC sends the numerical value (say, 255) as SOP, 2,5,5,EOP.
No, it sends the data as SOP, '2', '5', '5', EOP. Small, but important, difference.

The arduino receives each byte separately..(It knows when all the data has been received because of the EOP and SOP. )

And then 'reassembles' the bytes into the appropriate int value (which is 255 in this case)..
Not exactly. The code I showed "reassembles" the bytes into a string (a NULL terminated array of characters), "255", which the atoi() function can convert to a numeric value (the "255" becomes 255).
31811  Using Arduino / Programming Questions / Re: Help! Arduino Joystick on: December 07, 2011, 05:18:34 am
  int analogInput_1 = 2;  analogInput_2 = 3;
  int value_1 = 0;  value_2 = 0;
Multiple declarations in one statement are separated by commas, not semicolons. Even better, though, would be to simply not do this. Use one statement per variable declaration. Trust me, you'll really appreciate doing this as your code gets larger.

That should be Serial.begin(9600); That author was using some pre-release version of the Arduino software, many, many years ago, apparently. Otherwise, the author is an idiot.
31812  Using Arduino / Programming Questions / Re: Webswitch programing? on: December 07, 2011, 04:56:21 am
Sry but i don't understand the arduino language. I only know some basics law, not more.
Head over to Gigs and Collaborations, then. Offer to pay someone to write the code for you. I've already done 90% of the work. It isn't rocket science to look at the changes that have been made to your code that doesn't compile, and see how to change the rest of the code.

If you won't (not can't) do it, then you'll need to pay someone else to do it.
31813  Using Arduino / Programming Questions / Re: handling the analog input values on: December 07, 2011, 04:44:47 am
You might want to look at the map() function. Map the range 0 to 1024 to 0 to 31 to get values between 0 and 30. Map from 0 to 1024 to 0 to 30, and add 1, to get values in the range 1 to 30.
31814  Using Arduino / Programming Questions / Re: Interrupt/Exit a running sketch? on: December 06, 2011, 12:51:04 pm
Any help?
Same thing that is always advised. Get rid of all the calls to delay().

Look at the blink without delay() example to see how to use millis() to determine when it is time to do something, instead. Just like you would, with just a watch.
31815  Using Arduino / Programming Questions / Re: Reading analog pins writing them in an array... i don't know why but it works! on: December 06, 2011, 12:41:53 pm
how is it possible that this works? is it a "magic" trick of the code?
No, of course not. A0, A1, etc. are #defined, to make it easier to use code, on any Arduino, that needs to use the analog pins as digital pins. A0, on the Mega is assigned the value 54. On other Arduinos, it is assigned the value 14.
Pages: 1 ... 2119 2120 [2121] 2122 2123 ... 3234