sampleProgram
Dependencies: QEI accelerator bit_test cyclic_io cyclic_var cylinder event_var limit mbed mecanum motor_drive pid pid_encoder rs422_put sbdbt servo
Fork of 17robo_fuzi by
Diff: sbdbt.h
- Revision:
- 45:a32e8091901b
- Parent:
- 0:bf96e953cdb8
--- a/sbdbt.h Sun Sep 10 11:51:57 2017 +0000 +++ b/sbdbt.h Tue Sep 12 08:29:39 2017 +0000 @@ -1,4 +1,9 @@ /* +ver1.0 +Sbdbt Name(tx,rx) +sbdbtに接続するtx,rx + +ver2.0 Sbdbt Name(tx,rx) sbdbtに接続するtx,rx @@ -39,7 +44,7 @@ class Sbdbt { public : - Sbdbt(PinName mbed_tx, PinName mbed_rx) : SBDBT(mbed_tx,mbed_rx) { + Sbdbt(PinName mbed_tx, PinName mbed_rx, PinName pin_pairing) : SBDBT(mbed_tx,mbed_rx), pairing(pin_pairing){ } void begin(long baudrate) { @@ -47,6 +52,10 @@ SBDBT.baud(baudrate); SBDBT.attach(this, &Sbdbt::data_receive, Serial::RxIrq); } + + int get_pairingState(){ + return pairing; + } short shikaku; short l1; @@ -70,12 +79,13 @@ private : Serial SBDBT; + DigitalIn pairing; int read, data_start, checksum, byte, buffer[data_byte], data[data_byte]; int Left_X, Left_Y, Right_X, Right_Y ; - + void init() { open_data[0] = buffer[0] = data[0] = 128; open_data[1] = buffer[1] = data[1] = 0;