![](/media/cache/profiles/5d1c46732f4869197e9aae4d1f0bc888.jpg.50x50_q85.jpg)
Using LTC1485 simple transmit program
Diff: main.cpp
- Revision:
- 1:db0469ab641f
- Parent:
- 0:5f4b6ac9df07
--- a/main.cpp Sat Feb 25 07:32:42 2017 +0000 +++ b/main.cpp Sun Feb 26 06:10:45 2017 +0000 @@ -17,19 +17,14 @@ int index = 0; int buffer[5] = {0}; - +int address; int main() { rede=0; - int address = address1<<0 | address2<<1 | address4<<2 | address8<<3; - // int rs485_data[4]={0}; + address = address1<<0 | address2<<1 | address4<<2 | address8<<3; myserial.attach(&onInterrupt,Serial::RxIrq); while(1){ if(address == 0x01){ myled = 1; -// rs485_data[0]=buffer[1]; -// rs485_data[1]=buffer[2]; -// rs485_data[2]=buffer[3]; -// rs485_data[3]=buffer[4]; }else{ myled=0; } @@ -46,7 +41,7 @@ /*データ準備*/ TxData[0] = '#';//TAG - TxData[1] = 0x41;//ID + TxData[1] = address;//ID TxData[2] = 0x41;//data TxData[3] = 0x41;//data TxData[4] = (TxData[0]^TxData[1]^TxData[2]^TxData[3]);