We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › using serial within an object
Page Index Toggle Pages: 1
using serial within an object? (Read 556 times)
using serial within an object?
Apr 21st, 2010, 2:51pm
 
Hi all:

I'm still learning the best methodologies for OOP, and it seems to me that ideally I'd like to have an Arduino "object" that keeps up with all the latest stats from my Arduino, so that my main loop could just call:

Code:
println( myArduino.currentSpeed() ); 



To me, that would mean that ideally the "Arduino" class would implement "processing.serial.*", create its own serial object, and constantly check for updates.

Is this possible and/or a sane approach? Thanks in advance for your advice!

Adam
Re: using serial within an object?
Reply #1 - Apr 21st, 2010, 10:02pm
 
Ideally my parent object wouldn't have to do anything at all about the serial port; the "Arduino" object would just automatically wait for serial events all on its own. Is this possible?
Page Index Toggle Pages: 1