Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
SBUS.h
- Committer:
- sshogo
- Date:
- 2019-06-28
- Revision:
- 2:493d10424466
- Parent:
- 0:e2bc011508c7
- Child:
- 3:c004c3d1c349
File content as of revision 2:493d10424466:
#ifndef INCLUDED_SBUS_H
#define INCLUDED_SBUS_H
#include "mbed.h"
class SBUS {
public:
SBUS(PinName tx, PinName rx);
enum channelTag { right_RL, left_UD, right_UD, left_RL, sw1, sw2, sw3, sw4, sw5, sw6 };
enum stickName {
analog_rx,
analog_ry,
analog_lx,
analog_ly
};
enum switchPosition {
Low,
Neutral,
High
};
enum switchFPosition {
FHigh,
FLow
};
float getStickValue(int tag);
int getSwitchValue(int tag);
int getChannelValue(int tag);
private:
Serial com;
int stickMaximumValue;
int stickNeutralValue;
int stickMinimumValue;
int stickResolution;
int channel[16];
int receivedData[50];
float stickValue[4];
int switchFPositionValue[2];
int switchPositionValue[3];
int switchValue[12];
void receiveData();
void decordReceivedData();
void convertReceivedData();
};
#endif