![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
just load the code, hit reset, and turn on the rc controller while holding the button
main.cpp@0:35253c4bb774, 2018-11-28 (annotated)
- Committer:
- LukeMar
- Date:
- Wed Nov 28 20:08:13 2018 +0000
- Revision:
- 0:35253c4bb774
bind code
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
LukeMar | 0:35253c4bb774 | 1 | /* |
LukeMar | 0:35253c4bb774 | 2 | TESTS/binding/int_dsmx_22ms/main.cpp |
LukeMar | 0:35253c4bb774 | 3 | Spektrum binding test, internal DSMX 22ms |
LukeMar | 0:35253c4bb774 | 4 | D Evangelista, 2018 |
LukeMar | 0:35253c4bb774 | 5 | Test passed on 13 Nov 2018 |
LukeMar | 0:35253c4bb774 | 6 | //official sailbot bind program |
LukeMar | 0:35253c4bb774 | 7 | */ |
LukeMar | 0:35253c4bb774 | 8 | |
LukeMar | 0:35253c4bb774 | 9 | #include "mbed.h" |
LukeMar | 0:35253c4bb774 | 10 | #include "rtos.h" |
LukeMar | 0:35253c4bb774 | 11 | #include "Spektrum.h" |
LukeMar | 0:35253c4bb774 | 12 | #include "unity.h" |
LukeMar | 0:35253c4bb774 | 13 | |
LukeMar | 0:35253c4bb774 | 14 | Serial pc(USBTX, USBRX); |
LukeMar | 0:35253c4bb774 | 15 | BindPlug bind_Plug(p13, p14, SPEKTRUM_INT_DSMX_22MS); |
LukeMar | 0:35253c4bb774 | 16 | char c; |
LukeMar | 0:35253c4bb774 | 17 | |
LukeMar | 0:35253c4bb774 | 18 | |
LukeMar | 0:35253c4bb774 | 19 | |
LukeMar | 0:35253c4bb774 | 20 | int main(){ |
LukeMar | 0:35253c4bb774 | 21 | |
LukeMar | 0:35253c4bb774 | 22 | pc.printf("Spektrum library version "); |
LukeMar | 0:35253c4bb774 | 23 | pc.printf(SPEKTRUM_VERSION); |
LukeMar | 0:35253c4bb774 | 24 | pc.printf("\r\nSpektrum binding test, internal DSMX 22ms\r\n"); |
LukeMar | 0:35253c4bb774 | 25 | pc.printf("Be sure to connect orange to p13, gray to p14, blk to gnd\r\n"); |
LukeMar | 0:35253c4bb774 | 26 | pc.printf("Should see blinking light, transmitter should attempt bind\r\n"); |
LukeMar | 0:35253c4bb774 | 27 | pc.printf("Was binding successful (y/n)? "); |
LukeMar | 0:35253c4bb774 | 28 | pc.scanf(" %c",&c); |
LukeMar | 0:35253c4bb774 | 29 | |
LukeMar | 0:35253c4bb774 | 30 | TEST_ASSERT_EQUAL_MESSAGE('y',c,"Binding test failed.\r\n"); |
LukeMar | 0:35253c4bb774 | 31 | |
LukeMar | 0:35253c4bb774 | 32 | } // main() for TESTS/binding/int_dsmx_22ms |