Show Posts
Pages: 1 ... 2249 2250 [2251] 2252 2253 ... 3084
33751  Using Arduino / Project Guidance / Re: Asymmetric keyboard matrix and keypad on: July 17, 2011, 08:45:18 am
If there is not a great deal of asymmetry, you could define bogus pins for the missing keys on the shorter rows, such as 255.

Since the Arduino can't read from pin 255, you will never be told that the non-existent button was pressed.
33752  Using Arduino / Programming Questions / Re: Split string or send different data to each DC motor via serial on: July 17, 2011, 08:41:49 am
Quote
but how can I split this string in arduino?
That all depends on how you are storing the characters read from the serial port.

Post the code you have now.

The strtok() function will be useful if you are storing the data in a character array. The indexOf() and substring() functions will be of interest if you are using the String object.
33753  Using Arduino / Project Guidance / Re: Wire logic high, multiple sensors. on: July 17, 2011, 08:15:26 am
The data sheet for the sensor will tell you how much current it draws. No link was given for the sensor, so, I don't know what that value is.

The data sheet for the Arduino will tell you how much current the +V pin can provide, assuming that the power source is up to the task. Generally, this is about 500 mA. If your sensors draw less than 80mA each, and they are the only things connected to the +V pin, then, yes the Arduino can supply enough current. If the sensors draw more then 80mA, or there is other stuff connected to +V, there is the potential for problems.
33754  Using Arduino / Project Guidance / Re: How to plot a graph on a screen shield ? on: July 17, 2011, 08:07:25 am
Quote
There is all you need for text, rectangle, circle, line, clear screen. But I haven't found for plotting values.
What kind of plot do you want? Generally a "plot" consists of lines and text...
33755  Using Arduino / Programming Questions / Re: sending serial value to visual studio on: July 17, 2011, 08:04:46 am
Quote
i am using C#, any guidance.
I'd suggest that you explain what you need help with.

Communication between the Arduino and the PC requires that the Arduino send data in a format that the PC application recognizes, and that the PC sends data in a format that the Arduino recognizes.

The Arduino then needs to be able to send and receive data.
The PC application then needs to be able to send and receive data.

On the Arduino side, the Serial class has all the required methods.
In the PC/C# side, the System.IO.Ports.SerialPort class has all the required methods.
33756  Using Arduino / Networking, Protocols, and Devices / Re: Help with serial port Bluetooth module on: July 17, 2011, 07:49:11 am
Serial.write() is meant for sending individual bytes, not strings of characters. With nothing to indicate what constitutes a packet within a stream of data, the receiver is just guessing.

In this case, the Android application guessed wrong.
33757  Using Arduino / Programming Questions / Re: ARDUINO CLAP SWITCH on: July 17, 2011, 07:38:58 am
If you haven't any idea what options to list for the poll, isn't that a pretty good indication that you aren't conducting a poll?

I rarely help anyone that can't even figure out the basics of asking a simple question.
33758  Using Arduino / Programming Questions / Re: -solved- extra 1 added from nowhere? on: July 17, 2011, 07:36:58 am
Code:
    Serial.flush(); // clear serial buffer
Dump any data that you haven't read yet. Why?

Code:
    Serial.print(c);// print stored value   
The overload of Serial.print() that accepts an array of characters expects that array to be NULL terminated. Your array is not. Unexpected results are quite likely when you do not play by the rules.
33759  Using Arduino / Programming Questions / Re: Understanding state machines, with regard to temperature control on: July 17, 2011, 07:30:45 am
I did say to consider eliminating it, not to eliminate it unilaterally.  Whether you need that transition, or not, depends on what new state you end up in when that transition occurs, and what exactly happens in that state.

Since state2 means that everything is off, you get to that state when the heater is turned off, but that doesn't happen at the set-point (it happens when temp gets slightly above setpoint), or when the cooler is turned off, but that doesn't happen at set-point, either (it happens when temp gets slightly below set-point).

Generally, after defining all the states, one determines what actions are required during a transition, and what conditions must be true to trigger the transition. Any state that does not have transitions away from that state, with actions associated with the transition, is eliminated.

In your case, state2 (nothing on) does not have any transitions away from that state. So, is it really needed?
33760  Using Arduino / Programming Questions / Re: how would I create a "dead zone" on: July 17, 2011, 07:16:34 am
Creating a "dead zone" is easy. All that "dead zone" means, in this case, it that there is a range of values that is ignored. If one reading is 3550, the next reading of interest must be greater than or equal 3550 + some value or less than or equal 3550 - some value.

Code:
  Channel1Value = (pulseIn (Chan1, HIGH, 50000)/100); //read RC channel 1
The outer parentheses are not required.

Change that statement to:
Code:
int newVal1 = pulseIn(Chan1, HIGH, 50000);
if(newVal1+deadZone >= Channel1Value ||
   newVal1-deadZone <= Channel1Value)
   Channel1Value = newVal1;
Now, Channel1Value will have a new value only if it differed significantly from the previous value, where you define "significantly" by the value in deadZone.
33761  Using Arduino / Programming Questions / Re: sending serial value to visual studio on: July 17, 2011, 07:02:04 am
Use Serial.print() to send the pot value as a string. Use Serial.write(lowByte(potVal)) and Serial,write(highByte(potVal)) to send the value as two bytes.

Use appropriate methods on the PC to receive the string, and convert it to a number, or to receive two bytes and re-assemble as an int.
33762  Community / Gigs and Collaborations / Re: Is Arduino eco-system the proper solution for my project ? on: July 16, 2011, 07:43:27 pm
Quote
I need to evaluate if Arduino eco-system could be a way to log sensors and transmit that onto our server via gprs.
Arduino eco-system? Please explain what you are talking about.
33763  Using Arduino / Programming Questions / Re: Timer question on: July 16, 2011, 07:33:30 pm
Code:
if(now - lastPumpTime > pumpInterval)
How much of the following code do you want executed when this is true? If just the next line, no { or } are needed. If you want more than one statement executed, all the statements to be executes need to be enclosed in { and }.
33764  Using Arduino / Programming Questions / Re: Understanding state machines, with regard to temperature control on: July 16, 2011, 07:26:25 pm
It's the "do something when the temperature exactly equals the set-point" transition that will cause (is causing) you the most grief. In general, thermostats allow the temperature to drift a little under the set-point (don't turn on until the temp drops to 69 with a 70 set-point) or over the set-point (don't turn off until the temp gets to 71 with a 70 set-point).

Consider eliminating that particular transition.
33765  Using Arduino / Project Guidance / Re: Water Feature Feasibility on: July 16, 2011, 03:00:36 pm
Quote
want to make a water feature using a 1.5A 12v pump that runs off of a 12v battery that is recharged by a solar panel.
Power equals volts times amps, so your 1.5A 12V pump needs 18 watts per hour.

Quote
The pump would only be ran around 5 hours a day, if that.
OK, so, 90 watts per day, maximum.

Quote
The solar panel I found was really small, only $20, and only 2w.
So, in full sun, that panel will require 45 hours to replace what is used in one day.

Quote
My main question is how long would it take a 2w solar panel to recharge a 12v marine battery to full?
Unanswerable with more details on the battery, and irrelevant in any case.

You will need more than one of those solar panels to power recharge the battery that powers that pump.
Pages: 1 ... 2249 2250 [2251] 2252 2253 ... 3084