How to send the console arduino ctrl + z?

Hey !

How to send the console arduino ctrl + z?

2016-02-06-172426_549x329_scrot.png

Why would you want to do that? The Serial Monitor application has no idea what to do with a Ctrl Z.

ctrl-z is ASCII 26. All the control characters a-z are ASCII 1-26.

Serial.print((char)26);

// or 

Serial.write(26);

A bit of history: the control characters were originally about controlling teletype machines. The carrige-return line-feed sequence used to move the print head back to the start of a line and advance the paper feed roller by one line, and so on. Microsoft - for some unfathomable reason - decided to use ctrl-z to mark the end of a text file instead of the more correct ctrl-d (which is what unix uses).

What I'm saying is, sending a ctrl-z to a serial out won't necessarily do what you think it does, unless that serial out is writing to a text file on a windows file system.

Thanks for the clarification.

PaulMurrayCbr:
Microsoft - for some unfathomable reason - decided to use ctrl-z to mark the end of a text file instead of the more correct ctrl-d (which is what unix uses).

In the early days, Microsoft did some things like that because they were worried about copyright infringement. The infamous backslash is a prime example.

Ctrl-z predates Microsoft: it was used in Digital Research's CP/M. I'm pretty sure I used it on a DEC PDP too.

(Often wonder how the world would be if IBM had signed with Kildall not Gates.....)

Microsoft - for some unfathomable reason - decided to use ctrl-z to mark the end of a text file instead of the more correct ctrl-d (which is what unix uses).

Microsoft actually wrote a control-Z in the file at the end. Unix did not store a control-D in the file - control-D was how you generated an end of file signal when typing on a terminal. In Unix, the length of the file was stored in the file's inode, along with other info so that the length of the file could be known even before it was opened.

Pete