Show Posts
Pages: 1 ... 1889 1890 [1891] 1892 1893 ... 3234
28351  Using Arduino / Programming Questions / Re: Servo / Sonar Trouble on: March 10, 2012, 09:29:02 pm
Code changes are not going to be possible until you explain what you are trying to do. The digital pins can be use to output something that a low pass filter thinks is a variable voltage. But, all that it is really doing is toggling the pin on and off very quickly. The on time and off time vary, so that the filtered voltage appears to vary. In reality it is always 0V or 5V.

The digital pins can not input a variable voltage. That is what the analog pins are for. A digital pin is either HIGH or LOW (1 or 0). Expecting a digital pin to return a value from 2 to 1023 is unreasonable. Mapping a value from 0 to 1 from the range 0 to 1023 to the range 0 to 180 will result in an output of 0 always.

You need to describe what you are trying to do before we can tell you everything that needs to change.
28352  Using Arduino / Programming Questions / Re: need help as iam newbee this programe is hanging on the middlle some times runs on: March 10, 2012, 09:23:44 pm
Quote
its ok but the program is sturckup when relays picks connected to o/p,i had done maximum changes but result is nil at last posting in forum
I recognize most of those words, but arranged in that order they have no meaning. Try again.
28353  Using Arduino / Programming Questions / Re: Servo / Sonar Trouble on: March 10, 2012, 09:09:24 pm
It's strange that you know how to use Serial.print() in the first 3/4 of your program, but not in the last 1/4 of the program. What value are you reading from the pwPin? Since the digitalRead function you are using returns a value of either 0 or 1, the choices are pretty limited.

You map the value read from pin 6 to the range 0 to 180, which means that the only value that you will get from the map function is 0, which could explain why your servo never moves.
28354  Using Arduino / Interfacing w/ Software on the Computer / Re: Problem with sending Serial Data from Java to Arduino on: March 10, 2012, 11:44:09 am
Quote
The arduino part has already been checked with serial monitor and working perfectly
Working perfectly would include doing nothing more than it needs to do. Since that is not the case, it is not working perfectly.

Quote
My question is i want to send the output "wasd" each at a time instead of firing all at one time
Then, you need to have separate functions to send the characters, and send them only when appropriate.
28355  Using Arduino / Interfacing w/ Software on the Computer / Re: VB6 with Uno serialprint to text box on: March 10, 2012, 11:23:23 am
The Split command earlier on creates an array of strings, by splitting the specified string at the tabs. If the specified string contains 7 tabs, as yours should, you would get exactly 8 strings in the output array. That bit of code is dealing with the 9th and on substrings. Unless there is an error in communication, you shouldn't need that code.

If there is an error in communication, and there are more than 8 values in the packet, you probably want to discard the whole packet, rather than use the first 8 values on the first pass, and the rest on the next pass (with more added...)

If you are going to keep that code, though, when you re-create the original buffer, minus the first 8 values, you need to put the tabs back between the values as you reassemble the string.
28356  Using Arduino / Networking, Protocols, and Devices / Re: Interfacing with a 3G USB Modem on: March 10, 2012, 11:11:23 am
Quote
i need to connect a 3G USB modem with the usb connection of the board.
Does the 3G modem look like it has the same connector as the Arduino? I didn't think so.

Quote
I need to send sensor data to the 3G modem using HTTP protocol.
Not sure exactly what this means. Serial data is serial data.

Quote
Moreover, we want to use the USB power to power up the modem.
As in, you want the Arduino to send power out to the modem via it's USB input connector?

Quote
Can u tell me is it ok to use the USB connection to communicate between 3G modem and the arduino
Once you have figured out how to get two different kinds of inputs connected together, the rest should be pretty easy. Not.

Quote
What I really want to know is that do we directly connect the USB conncetion of the board and 3G modem and start sending HTTP commands or we need to add up some circuitry.
No, you don't. You need a USB Host shield, and a whole lot of software, in between. Before you ask, if you have to ask, no you can't.
28357  Using Arduino / Programming Questions / Re: Serial comms on: March 10, 2012, 10:58:26 am
Quote
I keep getting the error message:
That's not the only thing that appears in that window. A link to the troubleshooting section also appears. At that site, whine to the forum is way down on the list.
28358  Using Arduino / Interfacing w/ Software on the Computer / Re: VB6 with Uno serialprint to text box on: March 10, 2012, 10:52:57 am
Quote
So Serial.println is the CRLF?
Serial.println() does exactly the same stuff as Serial.print() with the addition that it sends a carriage return and line feed to the serial port, too (after the data it sends).

So, yes, I think that is a better way to send the data.

Code:
   If InStr(Buffer, vbCrLf) Then                        ' if the TAB char found then all 8 fields are in.
When the code and the comments disagree, the comment doesn't serve much purpose, does it?

So, what IS in buffer when this function returns true?

What is in the TempBuffer elements? Why do you need to when assign those strings to floats, and then assign the floats to text fields? Seems like a lot of overhead when what you want is to get string data from the serial port and display it is string fields on the form.

Code:
            Buffer = ""                                      ' empty the Static buffer
            For I = 8 To UBound(TempBuffer) - 1
               ' retain any extra data
               Buffer = Buffer & TempBuffer(I)
            Next I
What extra data? What about the tabs that used to separate the fields?
28359  Using Arduino / Programming Questions / Re: Function() vs Speed on: March 10, 2012, 10:43:23 am
Quote
I guess that I should just have known, somehow, to add a C in my search term.
Or C++. After all, you are looking for how to use "inline" with a specific language.
28360  Using Arduino / Programming Questions / Re: wishield error on: March 10, 2012, 10:41:10 am
Quote
this is my final year engineering projet
And you still haven't learned any programming or how to do research? Please do not apply at Boeing.
28361  Using Arduino / Interfacing w/ Software on the Computer / Re: Problem with sending Serial Data from Java to Arduino on: March 10, 2012, 10:39:33 am
Quote
The Java code looks OK (some missing parenthesis), if the 4 parameters all are 1 then all "wsad" will be fired.
If the Java application does send "wsad", it won't affect the Arduino, since OP flushes the serial buffer after reading each character.

Which, in my opinion, is a serious mistake. Especially now with Serial.flush() doing different things on different versions of the IDE.

OP, I think you should give serious consideration to NOT flushing the input buffer if you are using 0023 or earlier. If you are using 1.0 or later, flushing the outgoing buffer is silly. Serial.flush() of the outgoing buffer simply blocks until the buffer is empty.
28362  Using Arduino / Interfacing w/ Software on the Computer / Re: VB6 with Uno serialprint to text box on: March 10, 2012, 10:32:37 am
Quote
The check for TAB is really needed !! as in your protocol the TAB is a record separator and the CRLF is a field separator.
Which, of course, is quite unusual. Sending value, tab, value, tab, value, tab, value, tab, value, CR, LF would make a lot more sense.
28363  Using Arduino / Interfacing w/ Software on the Computer / Re: Interfacing Arduino with PC (2-way communication) on: March 10, 2012, 10:27:17 am
Quote
i'm using Arduino-XBee Shield (without module)
That will probably work better WITH a module attached. There are jumpers on that shield that can be moved to allow the programming of the Arduino will the shield still attached, and then moved to connect the XBee to the serial port pins.
28364  Using Arduino / Interfacing w/ Software on the Computer / Re: how to use 2 usb serial port at the same time on computer on: March 10, 2012, 10:23:54 am
Quote
I think the OP is refering to can I use two arduinos at one PC by USB connection.
That is certainly possible.

Quote
So each arduino will have a comport number occupied and how to send data.
Each connection by an Arduino will create a new com port. The communication between the Arduino and the PC is exactly the same if there is one Arduino connected to one com port on the PC as if there are 12 Arduinos connected to 12 com ports on the PC.
28365  Using Arduino / Interfacing w/ Software on the Computer / Re: Controlling Arduino Through Wifi on: March 10, 2012, 10:19:44 am
Quote
Would it be a better idea to use a socket connection rather setting up the pc as a server and the arduiono/wishield as a client?
In my opinion, no.

Quote
what would you suggest doing?
Looking at the examples provided with the WiShield library. There are server and client examples. None use the webclient library, which is a good thing.

Quote
At the moment, I only plan on connecting the two together, I don't need multiple arduinos connected to the same PC.
The number of clients is not relevant. You could have one or a thousand.
Pages: 1 ... 1889 1890 [1891] 1892 1893 ... 3234