DJI NAZA-M controller (multi copter side) see: https://developer.mbed.org/users/okini3939/notebook/drone/

Dependencies:   FutabaSBUS NECnfc mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers NazaSBus.cpp Source File

NazaSBus.cpp

00001 #include "mbed.h"
00002 #include "drone.h"
00003 #include "FutabaSBUS.h"
00004 
00005 #define STICK_CENTER 0x400
00006 #define STICK_TILT   0x294
00007 
00008 FutabaSBUS sbus(p9, p10);
00009 
00010 void setFailsafeSBus (int flg) {
00011     sbus.failsafe(flg ? SBUS_SIGNAL_FAILSAFE : SBUS_SIGNAL_OK);
00012 }
00013 
00014 void setSBus (int ch, int num) {
00015     sbus.servo(ch, num);
00016 }
00017 
00018 void initSBus () {
00019     sbus.failsafe(SBUS_SIGNAL_FAILSAFE);
00020     sbus.passthrough(false);
00021     sbus.start();
00022 }