I have been using UNO quite a while, I observe 1 thing. Serial slows the loop the more i print in my sketch (time dependent calculation). Now my sketch had started to give some other values.
So If i switch over LCD would this happen again?
I have been using UNO quite a while, I observe 1 thing. Serial slows the loop the more i print in my sketch (time dependent calculation). Now my sketch had started to give some other values.
So If i switch over LCD would this happen again?
Can't answer the question but serial output is buffered up to 64 (or 63) bytes. If the buffer is full, your program will indeed slow down waiting for space in the buffer.
Solutions are to print less or print at higher baud rates.
[ I personally liked your tagline except the 15 yrs, I am also the same only difference 3 yrs absence yet. ]
I am using the configuration as baudrate of 9600 in Serial and set TWBR = 12 for 400 KHz I2C for UNO.
So how should I increase baudrate, for UNO because whenever I set to different value output go haywire.
Can you help me please?
I know I would be wrong in some basics only
What has I2C to do with serial?
Anyway, Serial.begin(115200) will give you a baudrate of 115200. You will need to set your serial monitor (or other terminal program) to use the same baudrate.
If your loop is constantly reading a device and sending the data via serial without delays you will probably still 'overload' the TX buffer. And maybe ask yourself, do I really need that data every millisecond or can I get away with reading and displaying it e.g. every second?
Sorry, Yup you were right I2C have nothing to do with Serial. Actually I am working on MPU6050 sampling rate so I just gave away my I2C configuration too.
sterretje:
If your loop is constantly reading a device and sending the data via serial without delays you will probably still 'overload' the TX buffer. And maybe ask yourself, do I really need that data every millisecond or can I get away with reading and displaying it e.g. every second?
And again as you were right i don't need such a fine time details either, even millis can do the job.
So now another question:
If i provide delay(some value) in my loop my calibration wont get disrupt right?
Thanks for the help.
PS
This is my context
Because MPU6050 sampling rate for (400 KHz I2C) is appx 2.61 KHz. so if I calculate time to get each value would be 1/(2610) = 0.3825 msec.
My concern was to not to loose each and every values(sort off useless concern now if I think).
So if i have to calculate velocity in that, i needed dt time( by standard physics formulae) and i calculated dt time of each loop.
My concern rose when my dt increase just by adding Serial.print().
I have no idea about the mpu6050. And I have no idea what you mean by calibration in this context.
Maybe others can advise. And maybe you can post your code so it might be more clear how you try to achieve what you want to achieve (don't forget to use code tags when posting code on this forum, read the stickies at the top of this section if needed).
Thanks for helping sterretje, I appreciate it.
Just a short question as from title, since as you mentioned earlier Serial has TX buffer. So what if I use LCD or parallel LCD, Timing won't effect either right?
Though I have no experience in LCD, but now I will seek for it.