Go Down

Topic: Problem using String (Read 997 times) previous topic - next topic

PaulS

Quote
is it a community-made one or a official?

Community made.

Code: [Select]
Don't want to lose my warranty
You are patching software on the PC, not something on the Arduino hardware.

Quote
Btw, is here any thank-you-function?

No, you actually have to type stuff.

unzufrieden

Well, so I have to thank u manually ;)
You gave me hope back! Ty sir.
I'll take this one, its the only one I found :)
pjrc.com/teensy/arduino_contrib.html

johnwasser

You could do it "The Arduino Way".  :)

Code: [Select]
#include <MemoryFree.h>
void setup() {
  Serial.begin(9600);
}
void loop() {
  for (int n = 0; n <=100; n++) {
    int u = 20*n;
    int v = 30*n;
    Serial.print(n, DEC);
    Serial.print(", ");
    Serial.print(u, DEC);
    Serial.print(", ");
    Serial.print(v, DEC);
    Serial.print(", ");
    Serial.println(freeMemory(), DEC);

    delay(500);
  }
  Serial.println("Done"); 
}
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

unzufrieden

well..the string which is shown is the same as in the code above.
but I'm working with serialevent-methods..that wont work..every print will call it another time..i hoped to find a solution to fix the String/free()/what-ever bug.
I haven't found the proper patch yet but if there's one, I'll find it at all cost :)
TY though!

PaulS

Quote
but I'm working with serialevent-methods..that wont work..every print will call it another time.

I'm thinking that you don't understand how the serialEvent() method gets called, or serial data processing, then.

Using one Serial.print() or a dozen Serial.print() statements makes no difference to how the data is eventually shifted out the serial port, or how it is received on the other end.

Go Up