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

From Medien Wiki
Line 73: Line 73:




''// the objetcs name „leftMotor“ and the herein implemented function „setThrottle“ are separated by a dot.
[[File:OOPARD5.jpg]]
leftMotor.setThrottle(255);
rightMotor.setThrottle(0);
''




A positive side effect: your program gains readability by picking distinct names for your Objects and Methods.
A positive side effect: your program gains readability by picking distinct names for your Objects and Methods.


 
<br>
<br>


===Classes can contain other variables that can only be accessed „internally“===
===Classes can contain other variables that can only be accessed „internally“===