Show Posts
Pages: 1 ... 1172 1173 [1174] 1175 1176 ... 1743
17596  Using Arduino / Programming Questions / Re: Not expected values... on: August 22, 2011, 06:23:16 am
I just had a quick look at the library, and after the eight data bits, the receiver simply skips the stop bit, and then presumably re-arms ready for the next character.
I guess you could slip in an extra "  tunedDelay(_rx_delay_stopbit)" to skip parity too.
17597  Using Arduino / Programming Questions / Re: Serial Programming on: August 22, 2011, 05:36:25 am
Strictly speaking, after coming in on the serial line, it already is parallel data, stored in eight bit wide memory, but as PaulS has pointed out, you've missed telling us a whole lot of detail.

Did you follow-up on the suggestion here http://arduino.cc/forum/index.php/topic,69940.msg518293.html#msg518293 ?
17598  Using Arduino / Programming Questions / Re: Multi-dimensional array in eeprom on: August 22, 2011, 05:34:18 am
Quote
Quote
I think there is a much faster way of doing this?
There is. Look at for loops.
Not sure "for" loops are any faster, but they sure are more succinct/flexible.
I second the "look at for loops"
17599  Using Arduino / Programming Questions / Re: Multi-dimensional array in eeprom on: August 22, 2011, 03:39:41 am
Quote
I'm just wondering, how I would go about writing/reading a multi-dimensional array to/from eeprom?
One byte at a time.
Just define the number of rows / columns / planes etc and the size of the elements - the rest is simple arithmetic.
17600  Using Arduino / Programming Questions / Re: Not expected values... on: August 22, 2011, 01:37:39 am
Quote
OTher way to invert is to do

Serial.print((char)(255 - tabletteSerial.read()));
That's assuming that the start bit was recognised correctly.
17601  Using Arduino / Programming Questions / Re: millis help needed on: August 21, 2011, 02:38:15 pm
[slightly OT] I'm a bit of a newcomer to this, but the nine hour former limit strikes me as a little odd - 24 bits would be too short, and 25 bits is....just weird.
Does anyone have the old code?
17602  Using Arduino / Programming Questions / Re: Not expected values... on: August 21, 2011, 02:31:55 pm
First mention of softwareserial.
You could try the "invert" optional parameter to "begin"

Quote
NewSoftSerial myInvertedConn(7, 5, true); // this device uses inverted signaling
NewSoftSerial myGPS(3, 2); // this one doesn't
17603  Using Arduino / Programming Questions / Re: Not expected values... on: August 21, 2011, 01:37:39 pm
That's OK - if the device is RS232, the voltages could be +/- 5V (NOT TTL), but inverted wrt true TTL.
17604  Using Arduino / Programming Questions / Re: Not expected values... on: August 21, 2011, 11:25:26 am
Quote
i m working with a serial device with a known protocol and using 19200 8n1
TTL or RS232?
If the latter, what is doing the level conversion and inversion?
17605  Using Arduino / Programming Questions / Re: millis help needed on: August 20, 2011, 03:36:09 pm
You really need to work on that indentation.
If you type ctrl-t in the IDE, the IDE will attempt to correct it for you.
17606  Using Arduino / Programming Questions / Re: & and ? used in code on: August 20, 2011, 04:49:25 am
Code:
return ((nunchuck_buf[5] >> 1) & 1) ? 0 : 1
The parentheses give the order of evaluation:
(nunchuck_buf[5] >> 1)   evaluates first.
((nunchuck_buf[5] >> 1) & 1) is next
then the value of that expression is tested true/false (non-zero == true / zero == false)

You could write it out:
Code:
byte bit = nunchuck_buf[5] >> 1;
bit = bit & 1;
if (bit == 1)
  return 0;
else
  return 1;
17607  Using Arduino / Programming Questions / Re: & and ? used in code on: August 20, 2011, 04:26:46 am
& is bitwise AND.
Why do you think it doesn't apply in this situation?

? is the ternary operator (or tertiary) - if the condition to the left of the ? evaluatues true, the value of the expression to the left of the colon is returned, else the value of the expression to the right of the colon is returned.

Code:
return ((nunchuck_buf[5] >> 1) & 1) ? 0 : 1
says "take the sixth element of nunchuck_buf and shift it right one place.
Mask off the least-significant bit and test the resulting value.
If the bit is 1, return 0, otherwise return 1"
17608  Using Arduino / Sensors / Re: Reading an RC Receiver on: August 20, 2011, 04:22:09 am
That looks like a good start - why not try it?
17609  Topics / Robotics / Re: Camera interfacing with Arduino on: August 20, 2011, 04:20:56 am
Up there on the left is a link to "Main Site".
You need to go there.
17610  Using Arduino / Programming Questions / Re: Code Problems - need some advice on: August 19, 2011, 05:39:12 pm
Code:
long PATTERN_DELAY_MS = 0.5;
Storing a non-integer in an integer is rarely a good idea.
Pages: 1 ... 1172 1173 [1174] 1175 1176 ... 1743