Test probram to setup XBus servo settings.
Dependencies: ACM1602NI XBusServo mbed-src
This is just a working sample. This is setup tool for XBus servo. You can change all setting on XBus servo. Tested only on KL25Z
これはただの動作サンプルです。 これはXBusサーボ用のセットアップツールです。 このコードで、XBusサーボの全てのセッティングが変更できます。 KL25Z上でのみ動作確認しています。
Diff: main.cpp
- Revision:
- 0:3e197b983b65
- Child:
- 1:4fdeb414f4ce
diff -r 000000000000 -r 3e197b983b65 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Oct 02 08:47:49 2014 +0000 @@ -0,0 +1,40 @@ +/* main.c file + * + * for testing mbed XBusServo.cpp + * + * Copyright (c) 2014-2014 JR PROPO + * by Zak Sawa + */ + +#include "mbed.h" +//#include "I2CLCD.h" +#include "XBusServo.h" + + +//I2CLCD LCD(I2C_SDA, I2C_SCL); +XBusServo XBus(PTD3, PTD2, 10); +Ticker timer; + + + +void XbusIntervalHandler() +{ + XBus.sendChannelDataPacket(); +} + + + +int main() +{ + uint16_t theValue = kXbusServoNeutral; + + XBus.addServo(0x01, kXbusServoNeutral); + + printf("added"); +// timer.attach_us(&XbusIntervalHandler, kXBusInterval * 1000); + +// while(1) { +// theValue += 10; +// XBus.setServo(0x01, theValue); +// } +}