Show Posts
Pages: 1 ... 1887 1888 [1889] 1890 1891 ... 3063
28321  Using Arduino / Networking, Protocols, and Devices / Re: arduino and pcf8574 max cable length on: January 07, 2012, 09:53:26 am
Quote
What is the max cable length between an arduino and pcf8574 .
What is a pcf8574? Why should we go look that up, when you could have provided a link?

Quote
how much resistors need i use?
Only one, if it is the right size. Say about 1/8" in diameter or less, and about 3" long, or less.

28322  Using Arduino / Networking, Protocols, and Devices / Re: Arduino FIO / xbee wireless keypad with serial LCD on: January 07, 2012, 09:50:37 am
The XBees replace a wire between the two FIOs. Exchanging data is a simple as Serial.print() on one and Serial.available() and Serial.read() on the other.

How you been successful at getting the FIOs to exchange any data? If not, start simple(r).
28323  Using Arduino / Networking, Protocols, and Devices / Re: Communication between two Arduino BT on: January 07, 2012, 09:42:34 am
You mentioned that there are 4 serial ports involved when the two Arduino BTs are talking. I'd set each one in turn as the active port, and open the serial monitor for that port. You should end up with 4 of them open. Data should appear in at least one of them.
28324  Using Arduino / Programming Questions / Re: StringReplace not working, example broken. also some code help needed. on: January 07, 2012, 09:38:50 am
Your fromChar() function is replicating capabilities already present in the String class.
Code:
String aString(text);
The only way that your function would be value added is if the char array always contained exactly 30 characters and was not NULL terminated. It would be far better to make the array one character larger, and make sure that it is always NULL terminated.

Personally, I'd ditch the whole String class and use just NULL terminated char arrays.
28325  Using Arduino / Networking, Protocols, and Devices / Re: Arduino -> Xbee -> Xbee -> Shiftbright on: January 07, 2012, 09:32:36 am
Quote
So I was wondering if the Xbee could interface directly with something like a Shiftbrite. In my head I think I have it figured out as the ShiftBrites just need serial data control
Yes, the XBee should be able to communicate directly with the ShoftBrites. As long as the voltages match (the XBee is a 3,3V decice).
28326  Using Arduino / Networking, Protocols, and Devices / Re: GPS / EM-408 Trouble on: January 07, 2012, 09:28:50 am
Quote
The module should send data immediately after it started up right?
No. The data sheet says that it takes an average of 42 seconds to cold start.

Are you doing this:
Quote
RX: This is the main receive channel for receiving software commands to the engine board from
SiRfDemo software or from user-written software. (NOTE: When not in use this pin must be
kept “HIGH” for operation. From Vcc connect a 470 Ohm resistor in series with a 3.2v Zener
diode to Ground. Then, connect the Rx input to Zener’s cathode to pull the input “HIGH”.)
28327  Using Arduino / Programming Questions / Re: How i upload web page from sd card of ethernet shield w5100 for control leds? on: January 07, 2012, 09:10:59 am
There are examples provided with the SD library that show how to read from and write to the SD card. Learn how to use them independent of the Ethernet shield, and then combine the two to send data from the SD card.
28328  Using Arduino / Programming Questions / Re: StringReplace not working, example broken. also some code help needed. on: January 07, 2012, 08:56:20 am
Code:
       String temp2=temp.replace("\n","");
In 0022, this should have worked. In 1.0, the replace() modifies the current String. It does not make a copy. So, if looks like you are using 1.0.

In which case:
Code:
temp.replace("\n","");
will replace all carriage returns with nothing, in the String in temp.

Don't forget that the String may contain \r characters, too, depending on how the String object is created.
28329  Using Arduino / Programming Questions / Re: 2 continuous servo differential with one joystick on: January 07, 2012, 08:42:37 am
If the joystick value is greater than center + deadzone, it will have a value like 520 or greater, won't it? Mapping from 0 to 1023 to 0 to 180, when the value is really in the range 520 to 1023 doesn't make a lot of sense. Does it?
28330  Using Arduino / Programming Questions / Re: I Also Need help with parsing code! extracting variables from HEX string on: January 07, 2012, 08:38:51 am
Code:
  if(Serial1.read() == '0xFB')
'0xFB' is a multi-byte character constant. The single byte character read from the serial port will NEVER equal that value. Why did you put single quotes around the value?

Code:
  int length = serial1.read()      // this should be the value of the checksum - aka the length of the remaining string
Is it the length of the string or a checksum? The two are completely different things.

Code:
  if (Serial1.read() == '0x26')

Next:
Code:
if (Serial1.available())
{
  if(Serial1.read() == '0xFB')
  {
  int length = serial1.read()      // this should be the value of the checksum - aka the length of the remaining string
  if (Serial1.read() == '0x26')
  {
    char INCOMMING[length]
    for(int t=0; until = length, i++)
      INCOMMING = Serial1.read()
      }
If there is at least one byte to read, read 2+length bytes. That's anywhere from 1 to 257 of the 1 bytes that will be read, many erroneously.

You need to read the data differently. After determining that a start byte arrived, you need to wait for the length byte to arrive. Then, you need to wait for that number of bytes to arrive (but not all at once, since you might be sending more that will fit in the serial buffer).

Finally:
Code:
}}}
Don't ever do this again.
28331  Using Arduino / Programming Questions / Re: Cannot get ananlogWrite to take value on: January 06, 2012, 07:29:46 pm
Code:
     for (int j=i-1; j<13; j++) {
       stringIn[j] = ' ';    // null out string
     }
     Serial.println(stringIn);
Wrong. A string is NULL terminated, not space terminated. Only one NULL is required.
Code:
stringIn[i-1] = '\0';

Quote
Example: ~clr1255000000~
This example should turn on the red channel. It does not work... I can set the red channel manually to 255 and it works fine - it will not take the value that I'm placing in the array from the serial string.
When I send ~clr1000255000~ it activates the green channel just fine.
You are the only one that can see the serial output. Add some more Serial.print() statements to identify the raw data being dumped, and show us what you get.
28332  Using Arduino / Programming Questions / Re: Code longer doesn't work right in my Arduino One (Uno) on: January 06, 2012, 06:50:51 pm
Quote
Your EEprom is only guaranteed to at or around 10000 writes.
That should be 100,000 writes.
28333  Using Arduino / Interfacing w/ Software on the Computer / Re: Create application to enter data, send to Arduino and receive and display data on: January 06, 2012, 06:47:47 pm
Quote
I looked at Processing and so far I have not found an example to indicate I can use it to do what I want to do.
The form would have drop down menu to select information and boxes to enter data that needs to go to Arduino.
It needs buttons to start the process, pause, stop, etc.
It needs fields to display time and readings taking place in Arduino.
Processing is capable of talking to the Arduino, via the serial port. It is capable of drawing forms, etc. but it is a lot of work to do that.

A language like C# is much easier to use to design forms, with drop-down lists, text entry fields, etc.

Microsoft gives away Visual C# Express, if you want to go that route. PM me if you are interested in a C# forms-based application that talks to the Arduino, as a starting point for your project.
28334  Using Arduino / Programming Questions / Re: Marine biologist seek programming help with ph controller on: January 06, 2012, 04:11:20 pm
Quote
I am new to programming so I wonder if you perhaps also could show me how the ftoa code would look like and how the float could be used in an if statement.
Code:
float phVal = atof(stamp_data);
if(phVal > 8.11)
{
   // Kill my fish
}
else if (phVal < 3.0)
{
   // Egads. Do something quick!
}

I find it difficult that you got to the point where you are a marine biologist without learning anything about programming or how to use google.
28335  Using Arduino / Programming Questions / Re: USB shield and FTDI on: January 06, 2012, 03:52:03 pm
The Arduino can communicate directly with anything that presents a serial port. There is no reason to need to used the USB Host shield.

What is this device that you are wanting to communicate with?
Pages: 1 ... 1887 1888 [1889] 1890 1891 ... 3063