Pages: [1]   Go Down
Author Topic: OOP support  (Read 439 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 71
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi all, i've not been working with the arduino for more than a week or so... i'm curious if the wiring language has support for oop principles?... i've seen some syntax that seems to suggest that the language is at least object based, however i've had no luck in finding that sample again and i can't seem to find anything on the wiring website... the website only states:

... doesn't require users to understand more advanced concepts like classes, objects, pointers..., and the "more" link isn't pointing anywhere...

however, i'm pretty sure that the code sample i saw used the "new" keyword to create a new instance of some class...

thanks!
Logged

berlin
Offline Offline
Sr. Member
****
Karma: 0
Posts: 293
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

some arduino libraries are based on classes/objects. the syntax (standard c) should be available in simple sketches as well. haven't tried it though.

regards,
kuk
Logged

0
Offline Offline
Jr. Member
**
Karma: 1
Posts: 79
Combat, please!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

the system is C++ based, using avr-gcc, and within reason you can use any standard feature of the language. Remember that you're programming a limited machine and not a modern desktop machine though..!

Charlie
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 119
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hey idover,

the arduino does support OOP!  i've created a few libraries for it here:  http://svn.reprap.org/trunk/users/hoeken/arduino/library/

there is also a tutorial on creating your own libraries here: http://www.arduino.cc/en/Hacking/LibraryTutorial

its a bit tricky, but i'm really enjoying OOP on the arduino =)
Logged

Pages: [1]   Go Up
Jump to: