Show Posts
Pages: 1 ... 117 118 [119] 120 121 ... 224
1771  Using Arduino / Programming Questions / Re: problem in while language on: March 16, 2013, 12:02:44 pm
You mean nest an if statement within a while loop? Sure.
1772  Using Arduino / Programming Questions / Re: Compute Serial Transmition on: March 16, 2013, 09:54:40 am
I am familiar with sending the packets over the network and have with this setup. It works great. I send packets from my computer, and my iphone both with replies. Now I want to take the next step and make it do something.

Well, you certainly have our permission to proceed.
1773  Using Arduino / Programming Questions / Re: Switch-case loop problem?! on: March 15, 2013, 04:03:29 pm
So where in program should i re-declare the value of pos_tm1 and pos_tm2 in order not to cause any other problems?

You can't re-declare the variables, you can only re-assign them their original values. Declaration and Assignment aren't the same thing. The best place would probably be in your idle or 0 state.
1774  Using Arduino / Programming Questions / Re: From processing to arduino on: March 15, 2013, 03:52:38 pm
That's Processing. The example in the linked thread was a general idea about how to work with bytes and ints with the Arduino. You'll notice a couple posts down, there is a better, more portable way to do it.
1775  Using Arduino / Programming Questions / Re: Switch-case loop problem?! on: March 15, 2013, 03:36:50 pm
But the program in this case seems to decrement the position till 29.How is that possible?

Because it checks if 30 is greater than 29. It is, so it proceeds into the if block which decrements 30 to 29.
1776  Using Arduino / Programming Questions / Re: From processing to arduino on: March 15, 2013, 03:34:45 pm
Thanks, rely enjoyed the second link but when I put in "z = (int)(word(pos, posc));" it says the function does not exists 

What function doesn't exist? If you're trying to compile some code, and you get an error, not posting the entire code and the entire error is less than unhelpful.
1777  Using Arduino / Programming Questions / Re: sprintf with two char buffers >> not working? on: March 15, 2013, 03:28:42 pm
any idea what i'm missing?

The rest of your code.
1778  Using Arduino / Programming Questions / Re: From processing to arduino on: March 15, 2013, 03:21:12 pm
And what is that like?

Like this

and

This
1779  Using Arduino / Programming Questions / Re: From processing to arduino on: March 15, 2013, 03:16:47 pm
I am sending int like arduinoPort.write(pos); which is an int, how do I combine that with the strtok() command?

You don't. You read in the two bytes individually, and pack them into an int. strok() only works if you decide to use an ASCII encoding scheme.
1780  Using Arduino / Programming Questions / Re: Switch-case loop problem?! on: March 15, 2013, 03:13:52 pm
LE: I checked and the flag is switching to "1" in the 2nd cycle[when the sensor detects movement again] but the motor doesn't move....

pos_tm1 and pos_tm2 aren't getting reset to their original values.
1781  Using Arduino / Programming Questions / Re: Switch-case loop problem?! on: March 15, 2013, 02:51:25 pm
You don't bother to check the state variable?
1782  Using Arduino / Programming Questions / Re: From processing to arduino on: March 15, 2013, 02:50:15 pm
And how do I do that??

How do you decide which encoding scheme to use? Coin flip?

I personally prefer ASCII over binary because it is easier to keep in sync.
1783  Using Arduino / Programming Questions / Re: From processing to arduino on: March 15, 2013, 02:33:42 pm
In processing it is like this:
Code:
arduinoPort.write("h");
  arduinoPort.write(",");
  arduinoPort.write(pos);

Mixing ASCII and binary is rarely a good idea. Pick an encoding scheme and stick to it.
1784  Using Arduino / Programming Questions / Re: From processing to arduino on: March 15, 2013, 02:22:16 pm
Still the same I am don't know how to use it in my situation.

Typically it takes more than 15 minutes to read and understand stuff like this; It's always a good idea to setup some examples and play around with them until you have a better understanding.

Regardless, you haven't said anything about how the string that is sent over the Serial line is formatted.
1785  Using Arduino / Programming Questions / Re: Arduino Wireless Remote -- Help Please! on: March 15, 2013, 02:11:29 pm
I feel that it is really simple and I am working on a version of the code, but do you think that you could help me out?
Not without seeing the latest code you have been working on.
Pages: 1 ... 117 118 [119] 120 121 ... 224