Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
send nul on serial
26-08-2014, 03:34 PM,
#1
send nul on serial
Hi All
I use X3 and an "olimex pinguino-micro", and try to communicate through a binary protocol with a radio device.

However, I have trouble sending nul characters on Serial2:

char b;

b=0;
Serial2.printf("%c",b); // nothing

b=10;
Serial2.printf("%c",b); // works

Serial reception is fine though.
Suggestion, workarounds, anyone?
Windows, Icons, Mice and Pointers
Reply
26-08-2014, 06:06 PM, (This post was last modified: 26-08-2014, 06:07 PM by pingotg.)
#2
RE: send nul on serial
Maybe try
Serial2.write(b);

In case you never need printf you'll have a chance to save a lot of memory as well.

John
Reply
28-08-2014, 01:22 PM,
#3
RE: send nul on serial
(26-08-2014, 06:06 PM)pingotg Wrote: Maybe try
Serial2.write(b);

In case you never need printf you'll have a chance to save a lot of memory as well.

John

Yay, it worked. I hope someone will fill in the documentation page for it.

Thnx.
Windows, Icons, Mice and Pointers
Reply
28-08-2014, 05:16 PM,
#4
RE: send nul on serial
I figured it out by just reading the code, never even looked for doc!

John
Reply
29-08-2014, 09:55 AM,
#5
RE: send nul on serial
(26-08-2014, 03:34 PM)wimp#1 Wrote: char b;

b=0;
Serial2.printf("%c",b); // nothing

b=10;
Serial2.printf("%c",b); // works

Can you add this to the issue tracker ? Thank you.
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)