tak jeste jinak
Kód: Vybrat vše
NewSoftSerial mySerial(2, 3);
char catCmd[] = { 00, 00, 00, 00, 00 } ;
.
.
void ftCmd()
{
for (int i=0; i<5; i++){
mySerial.print(catCmd[i], BYTE);
}
}
.
.
catCmd[0] = 0;
catCmd[1] = 0x59;
catCmd[2] = 0;
catCmd[3] = 0;
catCmd[4] = 0xbb;
ftCmd();
nebo
Kód: Vybrat vše
#define FT817_CONFIG_EEPROM_READ 0xBB
#define FT817_ANY_BYTE 0x00
sendCATCommandChar(FT817_ANY_BYTE);
sendCATCommandChar(0x59);
sendCATCommandChar(FT817_ANY_BYTE);
sendCATCommandChar(FT817_ANY_BYTE);
sendCATCommandChar(FT817_CONFIG_EEPROM_READ);
coz je odeslani nejakeho prikazu po serialu do ty FT-817 tak bych rek ze to tak bude
Kód: Vybrat vše
serial.print(analogValue); // print as an ASCII-encoded decimal
serial.print("\t"); // print a tab character
serial.print(analogValue, DEC); // print as an ASCII-encoded decimal
serial.print("\t"); // print a tab character
serial.print(analogValue, HEX); // print as an ASCII-encoded hexadecimal
serial.print("\t"); // print a tab character
serial.print(analogValue, OCT); // print as an ASCII-encoded octal
serial.print("\t"); // print a tab character
serial.print(analogValue, BIN); // print as an ASCII-encoded binary
serial.print("\t"); // print a tab character
serial.print(analogValue/4, BYTE); // print as a raw byte value (divide the
// value by 4 because analogRead() returns numbers
// from 0 to 1023, but a byte can only hold values
// up to 255)
takze pokud si to BYTE vynechal tak to standartne odesila hodnotu 0-255 co ty prave potrebujes ale muzu se mylit ale vypada to ze to tak je