# Animated And Elegant Fidget Spinner Design

This is why I would like to know how to rotate an image briefly, and quickly, have it stop for a few seconds, and start again. For now though, this still looks pretty cool I think…what do you think please?

Looks good @icrltd4! What kind of trigger do you want for the spinner? If you have a premium account you could check for a #VAR_1# value of either 1 or 0 to get it to spin or not spin in the rotation window. If you have a free account use the accelerometer value of say>1 to get it to spin, and 0 to not spin in the rotation window. I think the accelerometer is better, kind of like a flick to the wrist of y axis gets it spinning & would be practical. The larger the value you could make it go faster even, with a multi if statement using a double \$\$ between different accelerometer and spin values.

1 Like

Thanks Brad, I thought it looked pretty cool for a starter lol

Try this expression in the rotation window, adjusting the values as you see fit:

`\$(accelerometerRawY())>=1&&(accelerometerRawY())<3?(#DWFSS#):\$\$(accelerometerRawY())>=3&&(accelerometerRawY())<6?((#DWFSS#)*3):\$\$(accelerometerRawY())>=6&&(accelerometerRawY())<9?((#DWFSS#)*8)::\$\$(accelerometerRawY())>=9&&(accelerometerRawY())<12?((#DWFSS#)*16):\$\$(accelerometerRawY())>=12?((#DWFSS#)*40):0\$`

This is saying if the accelerometer Y value is between 1 & 3, apply a rotation value of #DWFSS#. Or if the accelerometer Y value is between 3 & 6, apply a rotation value of #DWFSS# x 3. Or if the accelerometer Y value is between 6 & 9, apply a rotation value of #DWFSS# x 8. Or if the accelerometer Y value is between 9 & 12, apply a rotation value of #DWFSS# x 16. Or if the accelerometer Y value is greater than 12, apply a rotation value of #DWFSS# x 40. Otherwise, set rotation to 0. I didn’t test this, but it should work as I’ve used similar expressions many times.

Also, in a text element located outside of the screen view at say (0,-200), initiallize the accelerometer with the following inside the text window:

`(accelerometerX()) x (accelerometerY())`

Note, in the preview window in the web browser this won’t work, but in the app on an android phone preview and on the watch it should work. I’m not sure about apple watch preview as I’ve never tested it.

Edit:
After some testing, the accelerometer function doesn’t like multiple \$\$ with && in the expression too much. I found simply using
`\$(accelerometerRawY())>=2?(#DWFSS#*100):0\$`
works much better. But it isn’t as elegant as I hoped and is a little twitchy. Perhaps with more tweeking it will be useful to others?

1 Like

Bloody amazing This works brilliantly thanks Brad I’ll post it in Show Your Style shortly so everyone can have a look an examine it too (I speeded it up as well)