Python Forum
How can I add an end line character after every value that I receive?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I add an end line character after every value that I receive?
#7
Hi,
Thank you all for your replies. Since I was closer to my deadline of a milestone of the project, for now ...I used the code where MCU was sending an endline character.

(Mar-03-2022, 03:32 PM)deanhystad Wrote: Were you receiving data when the microcontroller was appending \n to the data?
Yes, I used the same code posted in the original question and that was working fine.

On looking deeper into the API being used on MCU, I got to know that data is being converted into 8 bits integer and transmitted. And thank you for the code, I will try using that.

@Jeff_t, No, the data is being transmitted as 8 bit integer. I am passing a 32 bit integer value in that "printf" statement, however, that 32 bit integer is being broken up into 8 bits and transmitted as 8 bits. Also, as I mentioned above, the code was working fine and those values ranging from in 70s were also expected.
in the 2nd picture, where, I receive data in continuous rows...I believe I was also expecting values like 4095,4094...you can see those are printed, so basically...I was receiving correct values but without any space/endline character to distinguish the values.
Reply


Messages In This Thread
RE: How can I add an end line character after every value that I receive? - by GiggsB - Mar-06-2022, 06:51 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to receive two passed cmdline parameters and access them inside a Python script? pstein 2 411 Feb-17-2024, 12:29 PM
Last Post: deanhystad
  Receive Input on Same Line? johnywhy 8 850 Jan-16-2024, 03:45 AM
Last Post: johnywhy
  How to continuously receive messages until specified to stop using Bleak jacobbreen25 3 2,254 Dec-28-2022, 04:25 PM
Last Post: jacobbreen25
  Writing string to file results in one character per line RB76SFJPsJJDu3bMnwYM 4 1,460 Sep-27-2022, 01:38 PM
Last Post: buran
  How to receive webcam capture on spout? buzzdarkyear 2 2,722 Jan-12-2022, 02:26 PM
Last Post: buzzdarkyear
  [solved] unexpected character after line continuation character paul18fr 4 3,546 Jun-22-2021, 03:22 PM
Last Post: deanhystad
  new line character project_science 3 2,175 Jan-01-2021, 02:32 PM
Last Post: project_science
  SyntaxError: unexpected character after line continuation character siteshkumar 2 3,246 Jul-13-2020, 07:05 PM
Last Post: snippsat
  Regex won't replace character with line break Tomf96 2 2,606 Jan-12-2020, 12:14 PM
Last Post: Tomf96
  how can i handle "expected a character " type error , when I input no character vivekagrey 2 2,800 Jan-05-2020, 11:50 AM
Last Post: vivekagrey

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020