You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
1.6 KiB

//TestTerSer.ino Terminal série et aff nombres
#include "TerSer.h"
#define Serialprint(v,BIN) TerBin8(v)
void setup() {
SetupTerSer();
}
uint8_t v8;
int8_t v8s;
uint16_t var;
int16_t vars;
void loop() {
TerText("Test TerSer.h"); TerCR();
Serialprint(0x35,BIN);
TerCR();TerCR();
v8=127; v8s=127; TerHex8(v8); TerDec8(v8); TerDec8(v8s); TerCR();
v8=129; v8s=129; TerHex8(v8); TerDec8(v8); TerDec8(v8s); TerCR();
v8=255; v8s=255; TerHex8(v8); TerDec8(v8); TerDec8(v8s); TerCR();
var=1025;vars=1025;
TerHex16(var); //6ms
TerDec9999(var);
TerDec16(var);
TerDec16(vars);
TerCR();
var=2049;vars=2049;
TerHex16(var); //6ms
TerDec9999(var);
TerDec16(var);
TerDec16(vars);
TerCR();
var=4097;vars=4097;
TerHex16(var); //6ms
TerDec9999(var);
TerDec16(var);
TerDec16(vars);
TerCR();
var=8193;vars=8193;
TerHex16(var); //6ms
TerDec9999(var);
TerDec16(var);
TerDec16(vars);
TerCR();
var=16385;vars=16385;
TerHex16(var); //6ms
TerDec9999(var);
TerDec16(var);
TerDec16(vars);
TerCR();
var=32767;vars=32767;
TerHex16(var); //6ms
TerDec9999(var);
TerDec16(var);
TerDec16(vars);
TerCR();
var=32769;vars=32769;
TerHex16(var); //6ms
TerDec9999(var);
TerDec16(var);
TerDec16(vars);
TerCR();
var=65535;vars=65535;
TerHex16(var); //6ms
TerDec9999(var);
TerDec16(var);
TerDec16(vars);
TerCR();
while (1) {
v8=TerGet();
TerCar(v8);
Echo();
}
}
/*
Test TerSer.inc
7F 127 +127
81 129 -127
FF 255 -001
0401 1025 01025 +01025
0801 2049 02049 +02049
1001 4097 04097 +04097
2001 8193 08193 +08193
4001 over 16385 +16385
7FFF over 32767 +32767
8001 over 32769 +32767
FFFF over 65535 +00001
*/