Show Posts
Pages: 1 ... 2250 2251 [2252] 2253 2254 ... 3063
33766  Development / Other Software Development / Re: Which Ethernet Shield on: July 01, 2011, 08:27:18 am
Crossposted AND offtopic. The netduino forum is down the road a ways.
http://forums.netduino.com/
33767  Using Arduino / Interfacing w/ Software on the Computer / Re: PWM Slider and Processing on: July 01, 2011, 08:13:28 am
Of course it can be done. What you are asking the Processing application to do is to add 'f'' and whatever value is in speed, and write those out as a single byte.

Then, you are expecting, in the Arduino sketch, to get a string of characters.

If you don't send a string, using the print() method in Processing, you can't expect to read a string on the Arduino.

Sending a string, and reading it the way you are is going to be an exercise in frustration.

Serial data transmission is SLOW. The delay() in reading the data is stupid. You need to make Processing send an end of packet marker, and you need to make the Arduino read all available serial data, up to the end-of packet marker.

If, on any given pass through loop, there is serial data, but no end-of-packet marker, just append the data to the string. If the end of packet marker is present, break out of the while loop. Then, test whether the last character read is the end of packet marker. If it is, you can use the data that was read. Then, reset the string to an empty string.

Note that there will not always be three characters in the value. A value between 100 and 180 will have 3 characters. But, a value from 10 to 99 will only have 2. A value from 0 to 9 will only have 1.
33768  Using Arduino / Networking, Protocols, and Devices / Re: Which Ethernet Shield on: July 01, 2011, 07:52:37 am
Quote
I need to use netduino plus with secondary ethernet. 
I think you want to head down the road to http://forums.netduino.com/
They don't answer Arduino questions over there...
33769  Using Arduino / Networking, Protocols, and Devices / Re: Non-Xbee Zigbee modules and the Arduino on: July 01, 2011, 07:46:24 am
Quote
Have come about quite a few modules based on TI's CC25XX (e.g. CC2530256) ZigBeee modules with UART interfaces, etc...
I suppose you could search the forum for success stories on using these modules. Then, buy them if you find anyone successfully using them.

Otherwise, the XBees are proven, easy to use technology, with error handling, retransmission, etc. built in.
33770  Using Arduino / Interfacing w/ Software on the Computer / Re: Servo/ESC control via Processing and Firmata on: July 01, 2011, 06:11:05 am
What sketch do you have on the Arduino when this Processing application is running? Is it the ServoFirmata sketch? If not, why not?
33771  Using Arduino / Programming Questions / Re: Reading Serial Data from Accelerometer on: July 01, 2011, 05:15:23 am
Well, you should not read anything from the serial port without checking that there is data to read.

Code:
void loop()
{
  if(Serial1.available() > 0)
  {
     int sensorValue = Serial1.read();
     Serial.print(sensorValue);
     Serial.println();
     delay(200);
  }
}
33772  Using Arduino / Programming Questions / Re: Not using delay () in a 'for' loop on: July 01, 2011, 05:03:43 am
Quote
I am trying to get rid of delay() from within a 'for' loop, for all the good reasons discussed elsewhere.
What else is the Arduino supposed to be doing while this code is running? Where are you reading from the potentiometers?

If you are to get rid of the delays, you need to implement a state machine. Replacing delay() with your own do-nothing-for-a-specified-period-of-time() function is not useful.

So, at any given time, you should be in one state (3 LEDs lit, for example), and waiting for the appropriate time to transition to another state (4 LEDs lit, for example). The millis() function and stored times are used to determine if it is time to transition to another state.

The tricky part (not hard, just requires some thought) is knowing what state to transition to, and what action(s) to perform during the transition to that state or the transition away from the previous state.
33773  Using Arduino / Programming Questions / Re: Reading Serial Data from Accelerometer on: July 01, 2011, 04:54:06 am
Quote
So what I should do is to bring in the data over Serial1 and send to Serial like this?
Wouldn't it have been faster to try that on the Arduino? Post on the forum and wait for an answer, or upload to the Arduino and observe first-hand the results. Which will general be faster? Which will be remembered longer?

But, the answer to the question is yes.
33774  Using Arduino / Programming Questions / Re: Help with servo code to make servo run for a few seconds when sensor is tripped on: July 01, 2011, 04:49:26 am
Quote
(the use of "delay" will probably get me ostracised, but I don't care)
Not if you're aware of the alternatives and impacts, and have chosen to accept the limitations that delay() brings to the party.

In this case, I'd say that delay was acceptable.

Add a second sensor, and another motor/servo/whatever, and delay() would no longer be acceptable.
33775  Using Arduino / Programming Questions / Re: NewSoftSerial does not name a type on: July 01, 2011, 04:34:04 am
Did you restart the IDE after downloading NewSoftSerial?

Open a new sketch. Use Tools + Import Library..., and select NewSoftSerial. If that is not an option, you didn't install NewSoftSerial correctly (in the right place).

If that is the case, you need to either install it correctly, or tell us what OS and what version of the IDE you are using, so we can help you determine where the files go.
33776  Using Arduino / Programming Questions / Re: [OT] Job Opportunity - Italy (Turin) on: July 01, 2011, 03:56:59 am
Wrong forum. Try Gigs and Collaboration.
33777  Using Arduino / Project Guidance / Re: need help selecting the right hardware on: June 30, 2011, 07:17:37 am
Quote
but it seems Arduino unattended control of a camera seems to be do-able.
As long as all you are doing is turning it on and off (taking still pictures/triggering it to take videos), yes.

Just don't expect the Arduino to track the cougar, or to post the video on the internet.
33778  Using Arduino / Interfacing w/ Software on the Computer / Re: PWM Slider and Processing on: June 30, 2011, 03:42:49 am
Code:
    arduino.write(function + Speed);
What do you think this is doing? If you think that it is going to write two bytes, 'f' and Speed, to the serial port, I'm afraid you are wrong. It just added 'f' and Speed and wrote ONE value to the serial port.

Two bytes == two writes.
33779  Using Arduino / Programming Questions / Re: To delay or not to delay - that is *not* the question! on: June 29, 2011, 10:18:34 am
Quote
How about a good discussion to just eliminate the blink with delay example?
Code:
// Hang on a minute
delay(60000UL);
33780  Using Arduino / Programming Questions / Re: 2 passwords (maybe more) on: June 29, 2011, 09:23:13 am
Quote
Pressing the 1234 works. pressing ABCD goes to do nothing.
None of my Arduinos have anything called a 1234 or an ABCD to be pressed. You need to show all of your code, so we have some idea what "pressing the 1234" and "pressing ABCD" mean.
Pages: 1 ... 2250 2251 [2252] 2253 2254 ... 3063