hi guys.
why serial monitor go slower when i ask to print multiple variable?
is because of arduino uno?
will be go faster if i use arduino mega?
How are you doing the printing ?
Printing several variables one after the other is bound to take longer than printing one variable.
UKHeliBob:
How are you doing the printing ?
Printing several variables one after the other is bound to take longer than printing one variable.
printing one after the other...
can i print them all together?
You need to post your code - otherwise we are just guessing.
And please use the code button </>
so your code looks like this
and is easy to copy to a text editor
A Mega runs at the same speed - 16MHz - as an Uno.
...R
can i print them all together?
Possibly but we don't know what you are printing.
const int buttonPin = 2;
int buttonState = LOW;
unsigned long int timer1 = 0;
unsigned long int timer2 = 0;
unsigned long int timer3 = 0;
unsigned long int timer4 = 0;
unsigned long int timer5 = 0;
unsigned long int timer6 = 0;
unsigned long int timer7 = 0;
unsigned long int timer8 = 0;
unsigned long int timer9 = 0;
unsigned long int timer10 = 0;
void setup() {
pinMode (buttonPin, INPUT);
Serial.begin (9600);
}
void loop() {
buttonState = digitalRead (buttonPin);
if (buttonState == HIGH) {
delay (5000);
}
timer1 ++;
timer2 ++;
timer3 ++;
timer4 ++;
timer5 ++;
timer6 ++;
timer7 ++;
timer8 ++;
timer9 ++;
timer10 ++;
Serial.print (" timer1");
Serial.println (timer1);
Serial.print (" timer2");
Serial.println (timer2);
Serial.print (" timer3");
Serial.println (timer3);
Serial.print (" timer4");
Serial.println (timer4);
Serial.print (" timer5");
Serial.println (timer5);
Serial.print (" timer6");
Serial.println (timer6);
Serial.print (" timer7");
Serial.println (timer7);
Serial.print (" timer8");
Serial.println (timer8);
Serial.print (" timer9");
Serial.println (timer9);
Serial.print (" timer10");
Serial.println (timer10);
}
This is a not-very-funny joke, right?
AWOL:
This is a not-very-funny joke, right?
no it's not a joke.
is it any way to run faster?
9600 baud is 960 bytes per second.... You're running into that. Higher baud will treat the symptom buy not the disease
Are you trying to put them on one line? If not, why all the whitespace?
Do you know about Serial.print() ? That doesn't send the newline
GrOnThOs:
no it's not a joke.
OK, I give up.
What is it?
An existentialist protest?
GrOnThOs:
is it any way to run faster?
Serial.begin (115200);
@GrOnThOs, considering what you are printing, why do you expect it NOT to go slower?
For example, it takes longer to eat three hamburgers than to eat one hamburger.
...R
OK guys thank you.