Show Posts
Pages: 1 ... 1886 1887 [1888] 1889 1890 ... 3066
28306  Using Arduino / Interfacing w/ Software on the Computer / Re: Which microcontroller to use for ipod & windows communication? on: January 08, 2012, 10:11:51 am
Quote
But what Im wondering is if after I program it, does it need some serial to usb connector or ftdi chip to relay information back to the computer through the usb?
This seems like such an obvious question. Yes, you need something to convert serial data (that the Arduino can generate/read to USB so that PC can understand it.

Quote
Or can I attach a male usb connector to the arduino mini and program it to relay information from the sensor back to the computer?
Attach it where? I don't see a place to connect it.
28307  Using Arduino / Programming Questions / Re: From RS232 to SD writing issue on: January 08, 2012, 10:06:53 am
On every pass through loop, you open the file, read one character from the serial port, write it to the file, and end.

The sender is continuing to send data as fast as possible. Eventually (very quickly, actually) the serial buffer fills up, and no more data can be accepted. By the time there is room in the buffer, the sender has finished sending all the data that the Arduino discarded.

There are a number of ways to deal with the problem. The most obvious is to open the file once, then read and store all the data until the EOF arrives. Store that, close the file, and end the while loop that is reading/writing to the SD card.

Even that might not be sufficient, since writing to the card is slower than reading from the serial port (or the sender writing to the serial port). In which case, you will need to implement handshaking. THe sender sends some number of bytes, and then waits for the receiver to ask for more.

Whether that is possible with your sender, I do not know.

If not, you will need to slow the serial speed down to the point where sending a character takes as long (or longer) as writing to the SD card. Or, you will need to find/develop a different sender. Or, simply put the SD card in the PC, write to it, then move the SD card back to the Arduino.
28308  Using Arduino / Programming Questions / Re: I Also Need help with parsing code! extracting variables from HEX string on: January 08, 2012, 09:46:28 am
After the led_PURPLE() function, that you say you get to, notice the break statement? That exits the while loop. You have the printing of started and ended and the test for started and ended in the while loop. You need to move the end of the while loop up/the printing and test down.
28309  Using Arduino / Programming Questions / Re: How do you program the arduino motor shield R3 on: January 08, 2012, 09:30:03 am
That page tells you what pin(s) you need to set HIGH or LOW to control the direction, and it tells you what pin(s) you need to analogWriite() a speed value to. What more do you need to know? Does someone need to come hold your hand?
28310  Topics / Robotics / Re: Using keyboard to control robot, breaking from a while loop on: January 07, 2012, 10:04:57 pm
Quote
Could I read in from the serial monitor again in the while loop?
Of course.

I think that you might be better off writing your own application on the PC that reads key-press and key-release events, and sends data (upper case for key press; lower case for key release) to the serial port. Processing could be used, or C# or other languages - whatever you know and like.
28311  Using Arduino / Programming Questions / Re: I Also Need help with parsing code! extracting variables from HEX string on: January 07, 2012, 09:57:35 pm
I know that you've said that the data is coming from a radio, but, specifically what kind of radio? It looks like you are getting different packet types. The FB (or 251) is consistent, but the length and packet type do not appear to be consistent.
28312  Using Arduino / Project Guidance / Re: Trying to use the ps2 mouse with the Arduino Mega 2560 on: January 07, 2012, 09:26:55 pm
Quote
I don't know if anyone else has had this same problem.
Lots of people have. The WProgram.h file was renamed to Arduino.h starting with 1.0.
28313  Topics / Robotics / Re: Using keyboard to control robot, breaking from a while loop on: January 07, 2012, 08:38:05 pm
Quote
For the serial monitor i just use PUTTY or teraterm.
Do these send the same value over and over when a key is pressed? How often?

No that any of that matters as once you start a while loop because a character was received, you never read again. You just expect to somehow KNOW that that character is no longer arriving, even though you aren't reading the serial port.
28314  Using Arduino / Programming Questions / Re: Syncronizing PHP and arduino on: January 07, 2012, 08:09:31 pm
I think we'd need to see your code. In loop(), you'd add a call to Serial.available() and to Serial read(), to see if PHP sent anything that looked like "Feed me!" (or whatever). if so, set a flag indicting that output should actually occur,

Prior to each call to output serial data, see if that flag is set. If not, don't call the Serial.print(), Serial.write(), or Serial.println() functions.
28315  Using Arduino / Networking, Protocols, and Devices / Re: Arduino -> Xbee -> Xbee -> Shiftbright on: January 07, 2012, 08:01:10 pm
Quote
It's not just serial — it's serial plus a clock — it uses the LPD6803 chipset.
It's not at all serial. It's SPI. I don't think that the XBees do SPI.
28316  Using Arduino / Programming Questions / Re: 2 continuous servo differential with one joystick on: January 07, 2012, 07:40:58 pm
Quote
that's what ive been doing to see what its been outputting...
Would you care to share that?
28317  Using Arduino / Programming Questions / Re: 2 continuous servo differential with one joystick on: January 07, 2012, 07:36:36 pm
I think that printing XaxisVar and steering, as you move the joystick from one end of the range to the other might give you a clue.
28318  Using Arduino / Programming Questions / Re: I Also Need help with parsing code! extracting variables from HEX string on: January 07, 2012, 07:32:53 pm
One thing that I would suggest is that you print a space after each value. That way you can see where the output for each byte starts and ends.

The difference between the char and byte output is explained by the signed/unsigned difference between a char and a byte.
28319  Using Arduino / Programming Questions / Re: I Also Need help with parsing code! extracting variables from HEX string on: January 07, 2012, 07:01:19 pm
If hinting that you should post your code is rude, I guess that I'll have to continue being rude. I'm sorry that you consider it so.
28320  Using Arduino / Programming Questions / Re: Syncronizing PHP and arduino on: January 07, 2012, 06:59:03 pm
Quote
Unfortunatly I think that will require wrapping the whole sketch in a checkserial loop which im trying to avoid (since everything else works).
I don't see why that would be necessary. Isn't the sending code in a single function? Or is it all over the place?
Pages: 1 ... 1886 1887 [1888] 1889 1890 ... 3066