Skip to main content
17 events
when toggle format what by license comment
Jun 10, 2019 at 20:31 vote accept Hubert B
Jun 10, 2019 at 20:28 comment added Hubert B @NickGammon. Update. If I insert a 100ms delay before using Serial1 the problem goes away. But that is not acceptable for the final program. The problem seems to be the same with direct use of Serial1 as it is with DualPrint so the original question is answered. A new question is how to control the position of new line characters in the Bluetooth terminal.
Jun 9, 2019 at 22:52 comment added Nick Gammon Some LCD screens don't recognize newlines for example. You have to explicitly tell them to go to a new line and/or column.
Jun 9, 2019 at 22:51 comment added Nick Gammon The Bluetooth terminal might not recognize newlines. Can you prove it does?
Jun 9, 2019 at 22:50 comment added Nick Gammon I doubt the timing will matter. Those bytes will be buffered and sent out by an interrupt service routine.
Jun 9, 2019 at 13:03 comment added Hubert B Should that look like this: virtual size_t write(const uint8_t *buffer, size_t size) { if (use_Serial) Serial.write(buffer, size); if (use_Serial1) Serial1.write(buffer, size); return 1; }
Jun 9, 2019 at 11:37 comment added Edgar Bonet The Bluetooth link should see the exact same byte stream whether you print through Serial1 or this class. Only the timing will be slightly different, so it could be that whatever receives the data is sensitive to the timing of the incoming bytes. This could be mitigated by overriding virtual size_t write(const uint8_t *buffer, size_t size).
Jun 9, 2019 at 11:32 comment added Hubert B I tried with both println("...") and print("...\n"), same behavior with both. I hard coded the same outputs with Serial and Serial1 and it works fine so nothing to do with Bluetooth. It is something to do with the new class.
Jun 9, 2019 at 11:19 comment added Nick Gammon No. The general technique should work OK. Perhaps the Bluetooth can't handle more than 30 bytes before throwing in a newline of its own. In any case, why not use println rather than print and then supplying your own newline?
Jun 9, 2019 at 11:13 history edited Hubert B CC BY-SA 4.0
edited title
Jun 9, 2019 at 10:57 history edited Hubert B CC BY-SA 4.0
added 4 characters in body
Jun 9, 2019 at 10:48 history edited Hubert B CC BY-SA 4.0
added 1688 characters in body
Jun 9, 2019 at 9:57 history edited Hubert B CC BY-SA 4.0
added 12 characters in body; edited tags
Jun 9, 2019 at 9:45 vote accept Hubert B
Jun 9, 2019 at 9:45
Jun 9, 2019 at 4:48 history became hot network question
Jun 8, 2019 at 22:00 answer added Edgar Bonet timeline score: 6
Jun 8, 2019 at 20:47 history asked Hubert B CC BY-SA 4.0