GMU:Functions and Classes (Arduino): Difference between revisions

From Medien Wiki
Line 57: Line 57:
===Classes are Data-types===
===Classes are Data-types===


We can use our „Motor“ - class the same way we are using other data - types (int, long, float).
We can use our „Motor“ - class the same way we are using other data - types (int, long, float).<p>
The following lines use that quality in order to implement two motors:
The following lines use that quality in order to implement two motors:


 
[[File:OOPARD4.jpg]]
''Motor leftMotor; //  declare an object of the type „Motor“ called „leftMotor“
Motor rightMotor; //  declare another object of the type „Motor“ called „rightMotor“
''
 
 


===Calling inner functions of a class (Methods)===
===Calling inner functions of a class (Methods)===