examples added

master
parent d298d26814
commit e107fd0990

@ -84,25 +84,25 @@ For more information please see the [ATmega328 Datasheet](http://ww1.microchip.c
### Function reference ### Function reference
| TerSer function | | | TerSer function | Description | Example Code |
| --------------- | --------------- | | --------------- | --------------- | --------------- |
| `Car(cc);` | Send code cc to the UART | | `Car(cc);` | Send code cc to the UART | `Car(' '); Car(32); Car(0x20); //All three print a space` |
| `cc=Get();` | Wait for a key depressed. Use Teraterm, too tricky with Arduino Terminal | | `cc=Get();` | Wait for a key depressed. Use Teraterm, or other terminal software that does not work line-oriented. | Car( Get() ); //Echo of the typed character |
| `Text("abcd");` | Send the text and add a space | | `Text("abcd");` | Send the text and add a space | |
| `Textln("abcd");` | Same with CRLF | | `Textln("abcd");` | Same with CRLF | |
| `CR();` | Send a CR-LF | | `CR();` | Send a CR-LF | |
| `Bin8(v);` | Display the 8 low bits of the variable v, converted to integers (all add a space) | | `Bin8(v);` | Display the 8 low bits of the variable v, converted to integers (all add a space) | `Bin8(33); // Output: 00100001` |
| `Bin16(v);` | Display the 16 bits of the variable v, with a dot in the middle | | `Bin16(v);` | Display the 16 bits of the variable v, with a dot in the middle | `Bin16(1035); // Output: 00000100.00001011` |
| `Hex8(v);` | Display the 2 nibbles of the variable v, converted to integers | | `Hex8(v);` | Display the 2 nibbles of the variable v, converted to integers | `Hex8(33); // Output: 21` |
| `Hex16(v);` | Display the 4 nibbles of the variable v, converted to integers | | `Hex16(v);` | Display the 4 nibbles of the variable v, converted to integers | `Hex16(1035); // Output: 040B` |
| `Hex32(v);` | Display the 8 nibbles of the variable v, converted to integers | | `Hex32(v);` | Display the 8 nibbles of the variable v, converted to integers | `Hex32(260); // Output: 00000104` |
| `Dec8(v);` | Display the variable v, with its signs if signed and non-significative space or zeros | | `Dec8(v);` | Display the variable v, with its signs if signed and non-significative space or zeros | `Dec8(33); // Output: +.33. or +033. or .+33` |
| `Dec16(v);` | Display the variable v, with its signs if signed and non-significative space or zeros | | `Dec16(v);` | Display the variable v, with its signs if signed and non-significative space or zeros | `Bin8(1035); // Output: +.1035. or +01035. or .+1035` |
| `Dec8u(unsigned); Dec8s(signed);` | Shorter code | | `Dec8u(unsigned); Dec8s(signed);` | Shorter code | |
| `Dec16u(unsigned); Dec16s(signed);` | Shorter code | | `Dec16u(unsigned); Dec16s(signed);` | Shorter code | |
| `Normal();` | ..+nnn default mode (a dot represents a space) | | `Normal();` | ..+nnn default mode (a dot represents a space) | |
| `Spaces();` | +..nnn best for tabular data | | `Spaces();` | +..nnn best for tabular data | |
| `Zeros();` | +00nnn if you prefer | | `Zeros();` | +00nnn if you prefer | |
| `Compact();` | +nnn same as Arduino, but a + is shown if positive signed variable | | `Compact();` | +nnn same as Arduino, but a + is shown if positive signed variable | |

Loading…
Cancel
Save