Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Point_obj{
- public:
- long steps;
- unsigned int seconds;
- void offset(int offsetSteps, int offsetSeconds){
- steps += offsetSteps;
- seconds += offsetSeconds;
- };
- void set(long setSteps, unsigned int setSeconds){
- steps = setSteps;
- seconds = setSeconds;
- }
- void prnt(){
- Serial.print(" step: "), Serial.println(steps);
- Serial.print(" time: "), Serial.println(seconds);
- }
- };
- class Segment_obj{
- public:
- Point_obj start, finish;
- byte smooth;
- void shift_key(int offsetSteps, int offsetSeconds){
- start.offset(offsetSteps, offsetSeconds);
- finish.offset(offsetSteps, offsetSeconds);
- };
- void prnt(){
- Serial.println("Data is:");
- Serial.println(" Start");
- start.prnt();
- Serial.println(" Finish:");
- finish.prnt();
- }
- };
- class Path_obj{
- public:
- byte TotalKeys;
- Point_obj Key[6];
- Segment_obj Segment[5];
- };
- void setup() {
- Serial.begin(9600);
- }
- void loop() {
- Path_obj Motor[3];
- Motor[0].Segment[0].start.set(0, 0);
- Motor[0].Segment[0].finish.set(5, 6);
- Motor[0].Segment[0].prnt();
- while(1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement