Show Posts
Pages: 1 ... 327 328 [329] 330 331 ... 838
4921  Using Arduino / Project Guidance / Re: Send TXT filles to arduino on: August 23, 2013, 11:07:56 am
Where do the changes come from? The more directly you access the current list the better - you don't really want a solution where you have to keep a copy of the list up to date.
4922  Using Arduino / Project Guidance / Re: Arduino Line following robot using PID on: August 23, 2013, 08:45:39 am
First of all I an bit of confused with my error value.. I mean how to drive the DC motors using this error value i got.

You don't. The error is an input to the PID. You use the PID control output to drive the motor. But it seems premature to worry about that unless/until you know whether your line detection is giving you accurate input data, and that you're capable of driving the motors correctly based on the PID output.
4923  Using Arduino / Project Guidance / Re: Controlling the speed and direction of a DC motor programatically on: August 23, 2013, 08:40:38 am
How would I go about doing this?

Understand what control algorithm you want to implement i.e. whether the motor speed is to be controlled by feedback from some sensor, simply by elapsed time, or some other criteria.

Set up the hardware to power and control the motor and write a simple sketch that carries out a simple sequence of motor actions to confirm you know how to control the motor.

Set up the hardware for any sensors you need and write a simple sketch that demonstrates you're capable of reading data from those sensors and get the results you expect.

Write the code which implements your chosen control algorithm to control the motor based on whatever inputs it needs.

Test, fix, repeat as necessary until it is good enough for your needs.
4924  Using Arduino / Project Guidance / Re: Serial Connection between 2 Arduinos on: August 23, 2013, 08:36:29 am
On the receiving side, use write() instead of println().

The problem is that you're receiving an ascii character code 48 (representing the character '0') but instead of writing the character code directly to the serial port (which would cause '0' to display in the serial monitor) you're printing the decimal number 48.
4925  Using Arduino / Project Guidance / Re: Arduino Line following robot using PID on: August 22, 2013, 07:50:23 pm
well the 3rd and 4th ques is my problem.

Perhaps one of them is. If you tried to answer them, it might get us closer to the solution.
4926  Using Arduino / Project Guidance / Re: Rebuilding a bingo machine on: August 22, 2013, 02:48:16 pm
In your example you have output states which are derived from input states.

The way to program this in C++ would be similar to this:

Code:
const byte IoPin = 2;
const byte BovenPin = 3;
const byte onderPin = 4;
const byte a1Pin = 5;

void setup()
{
    pinMode(a1Pin, OUTPUT);
}

void loop()
{
    byte a1State = digitalRead(IoPin) && !digitalRead(BovenPin) && !digitalRead(onderPin);
    digitalWrite(a1Pin, a1State);
}

You would probably want to choose more meaningful names for the pins, and the ones with numbers in their names might be best stored in an array, but hopefully the above gives you a starting point.
4927  Using Arduino / Project Guidance / Re: Arduino Line following robot using PID on: August 22, 2013, 02:39:00 pm
What is your hardware, and how is it connected to the Arduino?

Have you tested the hardware and connections, and if so - how?

Have you verified that your sketch accurately detects where it is relative to the line?

Have you verified that the technique you're using to move and steer the bot produces the effect you intend?
4928  Using Arduino / Project Guidance / Re: Feasibility? on: August 21, 2013, 07:31:58 pm
how would you put "or"?

Code:
if (distance >= 100 or distance == 0)
4929  Using Arduino / Programming Questions / Re: Can't recieve data from .php (work if .html) on: August 21, 2013, 11:45:12 am
If most of your sketch is not relevant to your problem then I suggest you create a minimal test sketch that demonstrates the problem in the simplest possible way, and post that. The act of creating the minimal sketch will help you ensure you understand what is relevant to the problem, and in some cases may even enable you to solve the problem for yourself.
4930  Using Arduino / Programming Questions / Re: Nanosecond trigger pulse on: August 21, 2013, 09:06:03 am
Because pressing the push switch takes longer that 250ns im ending up with a longer pulse than i need.

For this part of the problem you need to use a technique that is usually called 'edge detection' to detect when the input changes between high/low and only send your pulse when the input changes. This technique is demonstrated in the StateChangeDetection example sketch.
4931  Using Arduino / Programming Questions / Re: Can't recieve data from .php (work if .html) on: August 21, 2013, 09:01:33 am
You're going to need to post all of your code to get any substantial help, but it doesn't look as if the fragment you posted makes any attempt to download from anywhere except www.google.fr.
4932  Using Arduino / Project Guidance / Re: Interactive LED "I NEED HELP" on: August 21, 2013, 08:17:07 am
Now that you've got something working, I recommend that you look for ways to make your sketch more robust, shorter and simpler.

You need to decide what you want to happen when you reach the last LED - do you want it to ignore further button presses, or start again from the far end?

The large chunk of code setting the LEDs on or off in the different states could be reduced to a few lines of code using an array to hold the LED pin numbers and a for loop to turn each LED on or off.

The Debounce example sketch shows how to read switch inputs that are vulnerable to contact bounce.
4933  Using Arduino / Project Guidance / Re: m-72 arduino ignition on: August 20, 2013, 04:22:11 pm
Screened wires are a good way to protect from radiated noise. Remember to only ground one end of the screen.

I don't understand what you mean by 'for inverters' - screened cable to carry the analog signals from the hall effect sensors would be sensible. I hope you aren't taking power to or from an inverter in the same cable.
4934  Using Arduino / Programming Questions / Re: Going to the Start of the Loop after an Interrupt on: August 20, 2013, 07:36:31 am
That's not an opinion - that is simple fact.

Actually it seems to me that there are quite a few opinions expressed in there - although they're opinions I happen to agree with.
4935  Using Arduino / Programming Questions / Re: EEPROM HexDump, strange characters at beginning of serial output on: August 20, 2013, 07:33:21 am
Well, its your code at the end of the day, but in my view it would make more sense to have a function that reads a specified number of bytes from a specified offset in the EEPROM and writes them into a supplied data buffer, and a function that takes a supplied data buffer and output text buffer and formats the data into the buffer as you wish, and then just print the content of the buffer. The main logic would be three function calls, and each function would be self-contained and provide a sensible abstraction.
Pages: 1 ... 327 328 [329] 330 331 ... 838