[Weather] My apologies for my redundancy
R. Scott Runnion
srunnion at mac.com
Sat May 12 13:19:27 EDT 2007
No surprise, but you nailed it, Tim! I'd identified the method to be
called, but was trying to figure out the syntax and where to use it.
After teaching C programming at the University level for a few years,
Java is certainly humbling me! Thanks for the assist!
Scott
Tim Bitson wrote:
> Scott,
>
> Since you're reading a '7', your weather station is most likely OK,
> and you have a coding error. If this was due to a reed switch being
> broken, you would be reading 16 (the error value) for some of your
> directions.
>
> Look in SimpleWeather.java where the wind speed and direction is
> displayed:
> ...
> // get wind speed & direction
> windSpeed = ws1.getWindSpeed();
> windDir = ws1.getWindDirection();
> System.out.println("Wind Speed = " + windSpeed + " MPH " + "from
> the " + ws1.getWindDirStr(windDir));
> ...
>
> the call the ws1.getWindStr(windDir) is what converts the numeric
> value ( windDir is 7 in your case) to the string ("SSE").
>
> Note that there was a typo in the book here. The downloaded code used
> the method getWindDirStr() while the code in the book used
> getWindDirString(). Since your project compiles, you must have
> figured this one out.
>
> If you code is correct, look through the method getWindSpeedStr() in
> the WindSensor class for typos.
>
> Let me know if this helps.
>
> Tim Bitson
> http://weathertoys.net
>
>
>
> On May 12, 2007, at 6:02 AM, R. Scott Runnion wrote:
>
>
>> correction: the 7 should pull 'SSE' from the array....
>>
>> R. Scott Runnion wrote:
>>
>>> Well, having publicly embarrassed myself with the below admission,
>>> let
>>> me now ask the subscriber community for the help I was originally
>>> seeking:
>>>
>>> I've got the Hobby-Boards Weather Station, barometer, temp/humidity
>>> running through their 6-port hub under Tim Bitson's SimpleWeather.
>>> All
>>> is working well, with the exception of the wind direction
>>> indicator. No
>>> matter how the vane is oriented, the display says "Wind Speed =
>>> xxxxxxx
>>> MPH from the 7" (the xxxxx reflect accurately the wind speed, but
>>> the 7
>>> (the value that should pull 'WSW' from the array for display) never
>>> varies. Any ideas? I'm concerned this may be due to a bad reed
>>> switch,
>>> but am not sure how to verify, or rectify if it is.
>>>
>>> Any suggestions would be appreciated.
>>>
>>> R. Scott Runnion wrote:
>>>
>>>
>>>> Sorry, tried to subscribe a second time in error.
>>>>
>>>> _______________________________________________
>>>> Weather mailing list
>>>> Weather at buoy.com
>>>> http://www2.buoy.com/cgi-bin/mailman/listinfo/weather
>>>>
>>>>
>>>>
>>>>
>>> _______________________________________________
>>> Weather mailing list
>>> Weather at buoy.com
>>> http://www2.buoy.com/cgi-bin/mailman/listinfo/weather
>>>
>>>
>>>
>> _______________________________________________
>> Weather mailing list
>> Weather at buoy.com
>> http://www2.buoy.com/cgi-bin/mailman/listinfo/weather
>>
>
>
> _______________________________________________
> Weather mailing list
> Weather at buoy.com
> http://www2.buoy.com/cgi-bin/mailman/listinfo/weather
>
>
More information about the Weather
mailing list