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.
Dependencies: AX-12A Dynamixel mbed iothub_client EthernetInterface NTPClient ConfigFile SDFileSystem iothub_amqp_transport mbed-rtos proton-c-mbed wolfSSL
Diff: ActionBuf.cpp
- Revision:
- 4:36a4eceb1b7f
- Child:
- 8:d98e2dec0f40
diff -r 3f26dd87d6f9 -r 36a4eceb1b7f ActionBuf.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ActionBuf.cpp Wed Dec 23 18:34:06 2015 +0000
@@ -0,0 +1,63 @@
+#include "mbed.h"
+#include "rtos.h"
+
+#include "ActionBuf.h"
+
+
+
+SafeCircBuf<ActionGroup, ActionBufSize, uint32_t> ActionBuf;
+
+bool ActionGroup::SetAction(ArmAction aId, char* args)
+{
+ if (strlen(args) < ActionArgSize)
+ {
+ ActionId = aId;
+
+ strcpy(ActionArg, args);
+
+ return true;
+ }
+ return false;
+}
+
+
+ActionSequence::ActionSequence()
+{
+};
+
+ActionSequence::ActionSequence(SequenceAction aType)
+{
+ ActionType = aType;
+};
+
+ActionSequence::ActionSequence(SequenceAction aType, vector<float>& vals, int ms)
+{
+ ActionType = aType;
+
+ if (aType == SA_SetGoal)
+ {
+ GoalVals = vals;
+ Ms = ms;
+ }
+ else if (aType == SA_Delay)
+ {
+ Ms = ms;
+ }
+}
+
+void ActionSequence::SetGoal(vector<float>& vals)
+{
+ GoalVals = vals;
+}
+
+void ActionSequence::SetDelay(int delay)
+{
+ Ms = delay;
+}
+
+void ActionSequence::SetAction(SequenceAction aType)
+{
+ ActionType = aType;
+}
+
+