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.
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
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
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......
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...
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