Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Adjust winddirection in CRbasic


Mavada Jan 23, 2011 01:23 PM

How do i adjust the winddirection in CRbasic?
Instead of turning my weather mast on the roof, i want to adjust the winddirection with app. 160 degrees.
I tried to multiply but then the value goes beyond 360 degrees... so that wont work.


Sam Jan 23, 2011 10:36 PM

Multiply? Why not add an offset and then shift back to 0-360 range? Maybe something like:

WindDir = WindDir + Offset
If WindDir > 360 Then WindDir = WindDir - 360
If WindDir < 0 Then WindDir = WindDir + 360


Mavada Jan 23, 2011 11:50 PM

ok, so how do i do it in your example for eg 160 degrees clockwise?

If WindDir > 360 Then WindDir = WindDir - 360
If WindDir < 0 Then WindDir = WindDir + 360


Mavada Jan 24, 2011 05:15 PM

ohh i get it i think...

WindDir = WindDir + 160
If WindDir > 360 Then WindDir = WindDir - 360
If WindDir < 0 Then WindDir = WindDir + 360

it took same time to sorten my brain......


Mavada Jan 24, 2011 07:36 PM

no that wont work, it doesnt go beyond 360 degrees ive found out...beyond 360 degrees should be 0 or 10, but it stays 360 degrees when it should be eg 10...


SEWESA Jan 24, 2011 10:13 PM

Mavada,

Check and make sure that you don't have this statement in your program. Most times this is input by shortcut.

If WindDir>=360 Then WindDir=0

Log in or register to post/reply in the forum.