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: mbed
PositionSetter.cpp
- Committer:
- wanchp
- Date:
- 2015-11-12
- Revision:
- 0:a4ad8cb94c43
File content as of revision 0:a4ad8cb94c43:
#include "PositionSetter.h" PositionSetter::PositionSetter() { // when no arguments, set to default // 3 axes (or motors )with 5 positions NofAxes = 3; NofPositions = 5; // first allocate memory // for Position Position = (Degree **) malloc(sizeof(Degree *) * NofAxes); for (int i = 0; i < NofAxes; i++) { Position[i] = (Degree *) malloc(sizeof(Degree) * NofPositions); } // for Duration Duration = (Time *) malloc(sizeof(Time) * NofPositions); Write = (bool *) malloc (sizeof(bool) * NofPositions); for (int i = 0; i < NofPositions; i++) { for (int j = 0; j < NofAxes; j++) { Position[j][i] = (Degree) i*j; } Duration[i] = (Time) i; Write[i] = true; } }