http://www.cycling74.com/forums/index.php?t=msg&goto=112936&rid=0&S=cd4c9adcc6a3d7899c62992c13f233a4
Search
C74 Logo
Products
max/msp/jitter
plugins
hardware
all products
Support
downloads
FAQ
authorize
contact
Purchase
online store
education
distributors
registration
Articles
tutorials
interviews
journals
newsletters
Community
forums
resource guide
calendar
user pages
Cycling '74
c74 records
press
about
contact
.
Members Members Search Forums Help Register Login Home
Home » Development » Java » weather station into max
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend Switch to threaded view of this topic Create a new topic Submit Reply
- weather station into max [message #112534] Sun, 12 August 2007 19:04 Go to next message
vodstrup
Messages: 41
Registered: September 2003
Member
Hi,
Hi - mxj works! cool, but...
I have an issue that I could use some advice with:
Background on my project:
I have built a weather station (full of fun wind, solar, temp, etc.
sensors). This weather station uses the "1-Wire" system from Dallas
Semiconductors. The java code I am using is called "simpleWeather"
and comes from weathertoys.net.
I'm on an Intel Mac and using a Keyspan USB adapter as the serial port
to talk to my sensors.
The "simpleweather" java code uses two libraries (one for the serial
adapter and one for the 1-Wire devices), a class for each sensor
(currently 6 total), and a main class called simpleWeather. All of
the classes use a "package" called simpleWeather.
I have (with help) successfully gotten this to work in Max. I have an
object named "mxj simpleWeather.SimpleWeather" that takes a bang in
its inlet and sends the data from each sensor to its own outlet (6
total).
It's finicky, but does work.
Here's my problem. When I "bang" the object, Max freezes (spinny
wheel mode) for about 2.5 seconds, and then it gives me my data.
Do any of you have any suggestions for a way that I might be able to
access the data without stopping whatever process is happening in
max/jitter?
Do you need more info to answer this - if so what?
..or since it's a serial port, am I better off trying to get the data
through the "serial" object? - tho I'm not sure I can convert/rewrite
the Java code in max.
thx in advance.
Bart
Report message to a moderator
- Re: weather station into max [message #112536 is a reply to message #112534 ] Sun, 12 August 2007 19:19 Go to previous messageGo to next message
wesley.hoke@gmail.com is currently offline wesley.hoke@gmail.com
Messages: 2204
Registered: May 2005
Senior Member
Sound like you need multithreading. Luckily in JAVA this is quite
easy. I've uploaded some code that is fairly straightforward and
shows how to do multithreading in JAVA. In particluar, look at the
FileUploader class. It inherits from runnable and has start(), run(),
and stop() methods for managing the thread it contains. You can take
this class, slap your serial/USB stuff in it and it shouldn't block
Max anymore.
http://www.mat.ucsb.edu/~whsmith/AutoUpload.zip
wes
Report message to a moderator
- Re: weather station into max [message #112554 is a reply to message #112536 ] Sun, 12 August 2007 23:54 Go to previous messageGo to next message
vodstrup
Messages: 41
Registered: September 2003
Member
Great thx! I'm not exactly sure how to implement it, but let me hack
at it for a few days and see if/how it works. I also want to reread
some of the threading that is discussed in "Scheduler, Clocks, and
Executables, Oh My!" from the manual...
I might need to upload my main simpleWeather.java for you (or someone)
to see what's all going on under the hood.
bbw
On 8/12/07, Wesley Smith wrote:
> Sound like you need multithreading. Luckily in JAVA this is quite
> easy. I've uploaded some code that is fairly straightforward and
> shows how to do multithreading in JAVA. In particluar, look at the
> FileUploader class. It inherits from runnable and has start(), run(),
> and stop() methods for managing the thread it contains. You can take
> this class, slap your serial/USB stuff in it and it shouldn't block
> Max anymore.
>
> http://www.mat.ucsb.edu/~whsmith/AutoUpload.zip
>
> wes
>
--
bartwoodstrup.com
vodstrup.com
Report message to a moderator
- Re: weather station into max [message #112936 is a reply to message #112554 ] Thu, 16 August 2007 18:33 Go to previous message
vodstrup
Messages: 41
Registered: September 2003
Member
Hey Wes - thanks again. That was really easy to implement and worked great!
Bart
On 8/13/07, bart woodstrup wrote:
> Great thx! I'm not exactly sure how to implement it, but let me hack
> at it for a few days and see if/how it works. I also want to reread
> some of the threading that is discussed in "Scheduler, Clocks, and
> Executables, Oh My!" from the manual...
>
> I might need to upload my main simpleWeather.java for you (or someone)
> to see what's all going on under the hood.
>
> bbw
>
>
>
> On 8/12/07, Wesley Smith wrote:
> > Sound like you need multithreading. Luckily in JAVA this is quite
> > easy. I've uploaded some code that is fairly straightforward and
> > shows how to do multithreading in JAVA. In particluar, look at the
> > FileUploader class. It inherits from runnable and has start(), run(),
> > and stop() methods for managing the thread it contains. You can take
> > this class, slap your serial/USB stuff in it and it shouldn't block
> > Max anymore.
> >
> > http://www.mat.ucsb.edu/~whsmith/AutoUpload.zip
> >
> > wes
> >
>
>
> --
>
>
> bartwoodstrup.com
> vodstrup.com
>
--
bartwoodstrup.com
vodstrup.com
Report message to a moderator
Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Java search path for libraries
Next Topic: Dialog Box blocks movie playback
Goto Forum:
-=] Back to Top [=-
Current Time: Tue Sep 22 14:01:47 MDT 2009
.:: Contact :: Home ::.
Powered by: FUDforum 2.8.0RC2.
Copyright ©2001-2009 FUDforum Bulletin Board Software
Tuesday, September 22, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment