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
Diff: template.cpp
- Revision:
- 0:6e2aac29a2ea
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/template.cpp Tue Mar 10 08:16:19 2020 +0000 @@ -0,0 +1,48 @@ +/* +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 :( +} \ No newline at end of file