Show Posts
Pages: 1 ... 328 329 [330] 331 332 ... 745
4936  Using Arduino / Project Guidance / Re: Automotive Compression Tester on: May 14, 2013, 09:10:57 am
In that case I suggest stepping back from the problem - apply a known constant voltage to the analog pin and see whether the analogRead returns the expected corresponding value. From what you've found so far, it probably doesn't.

The ADC conversion is done relative to an analog reference voltage. If your calculations are based on the assumption that an input of 1023 corresponds to exactly 5.000 Volts, and the analog reference voltage is something different, then your calculations would be inaccurate. For example, if the supply voltage on the Arduino was below 5V then the reference voltage would also be lower, which would cause the ADC to return higher values.

You need to ensure that the AREF voltage is stable, and not less than the highest voltage you need to measure. If the problem is that the 5V voltage is varying and causing the AREF voltage to vary, then you fundamentally have to address that. If the AREF is stable but not exactly 5V then you could either change the AREF voltage to the required value, or update your calculations based on what the reference voltage actually is.

4937  Using Arduino / Project Guidance / Re: Telemetry for multiple Heart Rate Belts on: May 14, 2013, 08:58:26 am
I don't know what 'polar coded heart belts' are. If this is an existing sensor with a known interface, perhaps you could post a link to a spec for the sensor plus any information you have about what sort of interface they provide?
4938  Using Arduino / Programming Questions / Re: Very Complicated Debugging of a 12 Servo Biped on: May 14, 2013, 08:50:10 am
Is there a cleaner way to add this, it is called every time Fractiondone is increased, once per loop

At the moment your code is all blocking. Given the complexity of the movements you're trying to create, I think a non-blocking structure would work better.

Instead of:
for (FractionDone = 0; FractionDone <= 1; FractionDone = FractionDone + FracStep)
   // move servos ...
use the approach demonstrated in the 'blink without delay sketch to determine whether it's time to move either leg, and then move it.

This would make it far easier for you to control the speed and timing of each leg movement.

You're asking specifically about how to incorporate a weight shift into the walking sequence. It's not clear from the code what mechanism you use to control weight shifting. Do you control it via hips or ankles, or just by controlling the length of each leg and letting the grounded foot roll sideways? If it's initiated explicitly by moving hips/ankles then you'd need to have a sequence of movements sycnronised with the leg movement. If it's done by having the whole biped rock sideways then I guess you need to recalculate the arc that each foot moves through while it's on the ground so that the effective length of the leg varies cyclically during the stride so that the leg effectively shortens when you want the biped to fall towards that side, and lengthens when you want to push it away. The resulting sideways movement would cause weight transfer.
4939  Using Arduino / Programming Questions / Re: Thanks for proposals on: May 14, 2013, 07:45:33 am
What is the "official" way to clear / reset such an array (= get rid of any previous content like I currently do with sPropertyBuffer = "") with let's say 8 characters ?

Just write a null (zero) to the first character in the array.

If you are adding to the string one character at a time you might also be using a variable recording the current length of the string - in that case, you would need to zero the length variable as well.
4940  Using Arduino / Programming Questions / Re: Arduino serial communication php on: May 14, 2013, 07:43:04 am
When I run the php code ...

Since you're asking about a problem in PHP code, a PHP forum is the place to ask it.
4941  Using Arduino / Project Guidance / Re: Audio sampling from music playing over iTunes? on: May 14, 2013, 07:36:56 am
The USB connection provides a duplex serial connection, so the Arduino can send messages to an application on the PC and vice versa. I think the simplest way to achieve what you're looking for is to write a PC application which reads the audi stream being played on the PC, uses whatever algorithm you like to convert that to a stream of 0 .. 255 brightness values, and writes those values to the Arduino's serial port. On the Arduino side you would have a trivial sketch which reads bytes from the serial port as they arrive, and sends the corresponding PWM output to drive an LED at the specified brightness.

Chooise a suitably high speed for the serial port, and make sure your PC application sends brightness change messages slower than the maximum speed of the serial connection - this will ensure that the transmit buffers don't back up, which would introduce a lot of latency on the communication.
4942  Using Arduino / Project Guidance / Re: radio tx and logging to SD card. Problems with circuit isolation? on: May 14, 2013, 07:31:35 am
You don't say how long either the radio transmission or the SD storage take, but would it be feasible just to schedule them so that they don't interfere with each other?
4943  Using Arduino / Project Guidance / Re: sampling audio, web streaming and receiving (guidance help request) on: May 14, 2013, 07:23:51 am
the advantage of using Arduino is that I could leave, as I need, all the hardware installation working in the environment, and I would prefer not to abandon a computer in a field of grass, cicadas and so on.....

How will your device in the field connect to the computer in the studio?
4944  Using Arduino / Project Guidance / Re: Programing with php and serial port on: May 14, 2013, 07:20:03 am
Sir , the back end is an Arduino UNO.

... which seems irrelevant to your question. If you're having trouble with PHP code, a PHP forum is the place to ask for help.
4945  Using Arduino / Programming Questions / Re: Freeze after 20-90 minutes when using serial communication on: May 13, 2013, 07:50:38 pm
That sounds like memory corruption. I see you're using the String class, which is a known cause of heap corruption. I suggest you get rid of that and just use ordinary c-strings (null-terminated char arrays).
4946  Using Arduino / Programming Questions / Re: Very Complicated Debugging of a 12 Servo Biped on: May 13, 2013, 07:47:13 pm
What I need to know how to do is how to move servos while a for loop is running. It can't interrupt the movement, but it should have the ability to interrupt movement if I need it to.

You need to have some algorithm for determining the required position and speed of each servo. That might be a hard-coded timed sequence of actions if the biped is inherently stable when walking, or it might be via a feedback loop monitoring its state of balance.

For timed movements, you have a piece of code that runs repeatedly for each servo which calculates the required position for that servo at that time, and if it is not the same as the current position it moves the servo to the required position. You simply call this repeatedly for all servos fast enough to produce movements as smooth as you require.

I imagine that the code to calculate the required position and speed will also be controlled by some code that controls the gait i.e. decides when the left leg needs to swing forward, when it needs to stop, when it needs to straighten the leg to contact the ground, and so on. This gait management code would also run repeatedly and determine where the biped was in the walking cycle and whether it was necessary to advance to the next part of the walking cycle. (This is also where I'd expect to see weight transfer initiated.)
4947  Using Arduino / Programming Questions / Re: Serial loop randomly stops on: May 13, 2013, 07:38:30 pm
If I understand the code right, My Python script will send 64 bytes, and wait for the Arduino. The Arduino shouldn't send another NEXT until it is out of serial buffer data. The Python
script shouldn't send 64 more bytes until the Arduino processes everything it sent before. The RX/TX lights on my ftdi breakout are alternating as I'd expect.

The flow control in this example still seems to assume the serial input arrives fast enough to prevent the sketch seeing an empty receive buffer, until all 64 bytes have been received. That doesn't seem like a safe assumption to me.

Does this minimal sketch demonstrate the problem?
4948  Using Arduino / Project Guidance / Re: sampling audio, web streaming and receiving (guidance help request) on: May 13, 2013, 04:26:49 pm
That all seems feasible using conventional audio recording and transmission via a PC - I don't see anything that would involve an Arduino.
4949  Using Arduino / Programming Questions / Re: Is there an easy way to communicate 2 Arduino? on: May 13, 2013, 01:38:45 pm
when i hooked-up my 16x2 LCD it won't display numbers instead it shows steady scribble-like characters.

If you send it garbage, it's going to display garbage.

If you want it to display a text message, construct the text message and then print it to the display. The sprintf() function is a convenient way to format data values into a text message, if that's what you're trying to do.
4950  Using Arduino / Project Guidance / Re: arduino eclipse and serial communication on: May 13, 2013, 12:56:05 pm
when i try to connect to the serial port i get error that another unknown program uses the serial communication.Do you know how to solve this?

Verify that the serial port you're trying to use is indeed the Arduino's serial port.

Find that unknown program that has opened the Arduino's serial port, and stop it.
Pages: 1 ... 328 329 [330] 331 332 ... 745