Conceptual question about Arduino's loop() "speed" in relation to Serial.print
is there relation between output serial port on arduino , time "spend" in each runloop?
i mean, if had this:
1) loop slow down depending on amount of data outputted serial port?
2) can measure speed running at?
these questions arise project idea had blink laser @ high frequency photoresistor not "blinks" , miss few. based on serial.print() output don't know actual run loops printed out or if skipped. or maybe other problem entirely questions still remain in head.
thanks!
i mean, if had this:
code: [select]
void loop ()
{
// whole bunch of serial.print() , serial.println()
}
1) loop slow down depending on amount of data outputted serial port?
2) can measure speed running at?
these questions arise project idea had blink laser @ high frequency photoresistor not "blinks" , miss few. based on serial.print() output don't know actual run loops printed out or if skipped. or maybe other problem entirely questions still remain in head.
thanks!
1) loop slow down depending on amount of data outputted serial port?
of course.
quote
2) can measure speed running at?
yes...
code: [select]
void loop( void )
{
static unsigned long previous;
unsigned long now;
unsigned long delta;
= micros();
delta = - previous;
previous = now;
// delta = time spent in last call loop
// stuff goes here
}
or...
code: [select]
void loop( void )
{
static unsigned long previous;
unsigned long now;
unsigned long delta;
// stuff goes here
= micros();
delta = - previous;
previous = now;
// delta = time spent in call loop
}
Arduino Forum > Using Arduino > Project Guidance > Conceptual question about Arduino's loop() "speed" in relation to Serial.print
arduino
Comments
Post a Comment