Easy Training / Mbed 2 deprecated Kinematics_old

Dependencies:   mbed

template.cpp

Committer:
xenjamo
Date:
2020-03-10
Revision:
0:6e2aac29a2ea

File content as of revision 0:6e2aac29a2ea:

/*
class template by clemo
this file serves as a guide to creating a cpp class
when wirting functions for Easyfit please use this

put math, instructions and temporary declarations here
declarations that are permanent go in .h file!

i never coded c++ lol

how to use when creating own class:
replace "template.h" with something of your choosing
replace class name (EXAMPLE) fckn everywhere

write appropriate constructor (EXAMPLE::EXAMPLE)
delete any unwanted functions
put in your own functions by YOURCLASSNAME::functionname(bla,bla)    //same for public and private functions

*/


#include "template.h"

EXAMPLE::EXAMPLE(int _inc, int _start){
    
    this->initvalue = _start;   //sets startvalue
    this->inc = _inc;           //sets increment
    this->useless();            //prints a happy little message
}


void EXAMPLE::incrementSum(int v1){
    for(int i = 0; i < v1; i++){
        sum += inc;
    }
}

void EXAMPLE::resetSum(void){
    sum = 0;
}

int EXAMPLE::getSum(void){
    return sum;   
}

void EXAMPLE::useless(void){
    //printf("congrats");       //printf doesnt work :(
}