Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

double time output #19

Open
mikrocoder opened this issue May 7, 2024 · 3 comments
Open

double time output #19

mikrocoder opened this issue May 7, 2024 · 3 comments

Comments

@mikrocoder
Copy link

Hi,

can you please change the double time issue? Left is sufficient. The time does not have to be repeated at the end of each line. Can you please correct this? That would be very nice.

WebSerial 2x time

@asjdf
Copy link
Owner

asjdf commented May 7, 2024

Could you show me your code?

@asjdf
Copy link
Owner

asjdf commented May 7, 2024

I think this is due to the newline character '\n' being sent separately to the frontend web page.

@mikrocoder
Copy link
Author

mikrocoder commented May 7, 2024

Hi,
yes, I send \n as end of line. This is exactly how it should be. The time may only be displayed with a new line on the left. Why does it react to \n with repeated time output? If I do not send \n there must be no line break.

This is the serial print class from Arduino. I use DEBUG_P. This is ...println() with \n.

#define WEBDEBUG // Income commenting for the web page output
//#define SERIALDEBUG // Commenting income for the serial output

#if defined(SERIALDEBUG) && !defined(WEBDEBUG)
  #define DEBUG_B(...) Serial.begin(__VA_ARGS__)
  #define DEBUG_T(...) Serial.print(__VA_ARGS__)
  #define DEBUG_P(...) Serial.println(__VA_ARGS__)
  #define DEBUG_F(...) Serial.printf(__VA_ARGS__)
#endif

#if defined(WEBDEBUG) && !defined(SERIALDEBUG)
  #define DEBUG_B(...) 
  #define DEBUG_T(...) WebSerial.print(__VA_ARGS__)
  #define DEBUG_P(...) WebSerial.println(__VA_ARGS__)
  #define DEBUG_F(...) WebSerial.printf(__VA_ARGS__)
#endif

#if (!defined(SERIALDEBUG) && !defined(WEBDEBUG)) || (defined(SERIALDEBUG) && defined(WEBDEBUG))
  #define DEBUG_B(...)
  #define DEBUG_T(...)
  #define DEBUG_P(...)
  #define DEBUG_F(...)
#endif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants