Show Posts
Pages: 1 ... 64 65 [66] 67 68 ... 97
976  Using Arduino / Project Guidance / Re: Help with EKG on: June 30, 2012, 11:39:29 am
I can only use the Serial monitor on windows but with a delay of 4ms and transmitting at 38400 baud, it shows the output as one continuous stream with no pauses. The Tx light is on solidly.

Pete
977  Using Arduino / Project Guidance / Re: Help with EKG on: June 29, 2012, 11:01:32 am
Quote
Is the 25 millisecond pause between each loop iteration the optimum time?
It's been a long time since I digitized EKGs but IIRC the sampling rate was 250Hz which is every 4ms. If you use println to send the data, it will produce up to 5 characters per sample which is 12500 bits/sec.

Quote
When I went lower than 20 my serial port seemed the freeze up and I'd have to restart my computer.
Do you mean the Arduino froze or the PC? The PC shouldn't have any trouble keeping up with 38400.

Pete
978  Using Arduino / Storage / Re: SD library ignoring Chipselect pin on: June 28, 2012, 03:06:58 pm
Pin 1 is one of the serial pins. You are using Serial.print as well, so things will get somewhat confused.

Pete
979  Using Arduino / Project Guidance / Re: Help with EKG on: June 28, 2012, 12:50:27 pm
Quote
which sets the cutoff frequency at 1.6Hz
Why such a low cutoff? The QRS complex has much higher frequency components than that.

Pete
980  Using Arduino / Programming Questions / Re: Ram Continuously Being Eaten on: June 27, 2012, 10:46:00 pm
Code:
#define TWOPOWER1_12
#define TWOPOWER_1_12
Lovely choice of names too. No room for confusion there!

Pete
981  Using Arduino / Programming Questions / Re: Program only runs if Serial.begin and Serial.println are present on: June 27, 2012, 07:43:37 pm
Excellent.
But, it would still be a good idea not to use the String library at all. It's a "gotcha" just waiting to creep up on you when it is least convenient.

Pete
982  Using Arduino / Programming Questions / Re: Program only runs if Serial.begin and Serial.println are present on: June 27, 2012, 06:42:19 pm
Quote
Here is the relevant code
The relevant code is always the bit you left out.

In your case, your mods to ReadTimeDate will cause trouble.
This is the relevant bit:
Code:
String ReadTimeDate(){
String temp;
.
.
.
return(temp);
}
You can't declare a string locally in the function and then return it as the value of the function. It is created on the stack when you enter the function and it is destroyed when you leave. The pointer to the string will point to random garbage.
It is really not a good idea to use the String library. It has one or more known bugs which make it a losing proposition. You will be much better off to do the string manipulation your self.
So, don't use the string library at all and don't pass temporary variables as the value of a function.

Pete
983  Using Arduino / Programming Questions / Re: Ram Continuously Being Eaten on: June 27, 2012, 02:38:50 pm
You've got several problems there.
- You can't use Serial.println in an interrupt routine. Well, OK, you can. But don't expect it to work.
- You shouldn't be using delay() in an interrupt routine. The whole point to an interrupt routine is to be as brief as possible.
- It looks like your attempts to debug a possible stack problem are only making things worse.

Remove the messing around with the stack. Put the Serial.println code and delay() in loop().

Pete
984  Using Arduino / Sensors / Re: Which library with DS1307? on: June 27, 2012, 09:55:05 am
It doesn't really matter how large the library is as long as it has the few functions that you need. When your sketch is compiled and linked, the linker will only load those functions that you actually use.
Pick a library and try it out.

Pete
985  Using Arduino / Programming Questions / Re: No matching function for call to 'glcd::puts(byte&, int)' on: June 26, 2012, 02:14:17 pm
Yes, it'll work for any "int" because the format I used was "%6d".
When you know that the integer can only be a smaller range, such as 0-60 for the minutes, you could change "%6d" to "%2d". There are other things that can be done with the format specifier but that should hold you for now.

Pete
986  Using Arduino / Programming Questions / Re: No matching function for call to 'glcd::puts(byte&, int)' on: June 26, 2012, 12:13:34 pm
It is complaining about your calls to puts which are like this one:
Code:
GLCD.Puts(minute, DEC);
Presumably, the GLCD library is only expecting a string - it doesn't work like Serial.print for example which does permit a second argument.
If you want to send "minute" and other variables as decimal strings you will have to do the conversion from integer to string yourself. Something like this should work:
Code:
char s_int[10];
.
.
.
sprintf(s_int,"%6d",minute);
GLCD.Puts(s_int);

Pete
987  Using Arduino / Project Guidance / Re: Reading Sine Wave on: June 26, 2012, 10:13:52 am
That looks like the error is in the drawing rather than the sampling. Each of the gaps is discontinuous with respect to time because two consecutive samples are spaced much further apart than they should be.
For example, with the gap at 3.8secs, if you were to take all the samples to the right of this gap and move them to the left, the gap would close and the two samples which make up the gap would "fit" together properly.

Pete
988  Using Arduino / Programming Questions / Re: Function fails rather spectacularly, I don't know how to describe it. on: June 25, 2012, 08:54:31 pm
Code:
float currentMap50[256]
This array is 1024 bytes long. If you are using a 328 based Arduino (Duemilanove, Nano etc.) you only have 2048 bytes of SRAM for your whole program and you gobble up half of it in that for loop.
That is probably what is causing the problem but without seeing the rest of your code there's no way to know.

Pete
989  Using Arduino / Programming Questions / Re: Arduino resets unexpectedly - NOT running out of SRAM on: June 25, 2012, 08:40:11 pm
I agree with jraskell and Delta_G. You have a classic case of stack overflow and/or SRAM corruption. The very fact that adding debugging statements moves the problem elsewhere screams of stack/SRAM problems and using the String library makes it smell like one too.
The problem is finding and fixing it.
I'd suggest that, where you can, you remove the use of Strings or at least try to abbreviate them, even if only temporarily.

Pete
990  Using Arduino / Sensors / Re: DS18B20 parasite power mode, output to common anode RGB LED. on: June 22, 2012, 05:19:43 pm
You should use the serial monitor with some debugging Serial.print statements to make sure that, first of all, your code is finding the DS18b20 properly and also that the converted temperature is a reasonable value. But first ...
Quote
I've noticed it keeps going through the initial if statement:
... that statement and everything that follows, up to but NOT including the ds.reset(), should not be in the loop function. They should be in setup().

Pete
Pages: 1 ... 64 65 [66] 67 68 ... 97