# Help with expression - If A+B intersect at #DWE#1 then after #DWE#2 spin graphic

I’ve been struggling with an expression lately and thought perhaps some kind person might be able to help me out.

I want to check if, after say between 1.5 to 1.6 seconds of turning the watch on, if a graphic intersects a certain point. If it does, then from then on the graphic will spin. If it doesn’t, then from then on the graphic will remain stationary.

Here is what I have come up with so far…
I have used the following range check equation posted by @Mellin in another thread:
(abs((2*x)-(y+z)))<(z-y)
Where
x is your tag that you want to check.
y is the start of the range.
z is the end of the range.

The graphic that I am checking has it’s X coordinate controlled by the accelerometer. So in this case the value of the X coordinate of this graphic is (160-((accelerometerRawX())*12)). This part of my draft watch face is actually working really well. This will be the x tag in @Mellin’s above equation. I want to check if this is located between X coordinates 145 and 175 between the initial time of turning the watch face on of 1.5 to 1.6 seconds. If it does, I want to rotate the graphic. If it doesn’t I want to leave rotation at 0.

Here is what I placed in the graphic’s rotation field:
\$(abs((2*(160-((accelerometerRawX())*12)))-(145+175)))<(175-145)&&(#DWE#)>1.5&&(#DWE#)<1.6?(#DWFSS#*20):0\$

This is great for what it is, and works for the time where #DWE# is between 1.5 & 1.6 seconds. As written, if the condition is met it rotates for 0.1 seconds at #DWE#=1.5 seconds, then stops. If it wasn’t met, it just never rotates. So it works for what it is. But not for what I want…

My problem is I want to keep this graphic rotating after 1.6 seconds of the condition being met. If it wasn’t met, I want to keep the rotation at 0. If anyone has any thoughts to get this working as intended, I’d very much appreciate it.

Thank you very much!

I’ve been thinking of the above expression problem lately. Perhaps somebody who is familiar with and uses variables in Creator Pro can help. I’ve so far been only using the free version & been able to do some pretty complex things, so I really don’t know what the capabilities of Pro are…

Can I set #Var_1# to say 1 if at the time say #DWE#=1.5 seconds the X coordinate of an object is within a certain range? Then go on and set #Var_1# to say 2 if it is within a different range? Then say if #Var_1# =1 apply a rotational expression on a 2nd object? Then go on and say if #Var_1#=2 do something different. Or if say #Var_1# doesn’t || 1 then the rotational expression on the 2nd object is 0?

Depending upon your input on your experience and use of variables, it may be time for me to try the Creator Pro trial and check it out…

Thanks…