Steering Wheel Rotation 180° CW to 180° CCW

...actually your snippet is not showing the angle of rotation up to 360 when I try it - is there a specific point to start the drag?

1 Like

If you are accurate enough to start the drag at pixel 1 on the left or pixel 300 on the right you will get to 720/-720, but you can do more than one drag as there is no touch up event to centre the wheel, and no "jumps" to a position when touch down.

1 Like

Tried again, slowly, as per instructions, it's jumping from + to - values. Anyway, the drag action should be applied to the steering wheel (App is a control box).

Edit:... I see now how your snippet works - make vertical drags along the left or right edge, up and or down. ABG was looking at that with a slider, but it's a compromise compared to a real controller with a steering wheel.

1 Like

A Public Domain steering wheel image by Chris Ward:
SteeringWheel

No, it doesn't look like a fan!

1 Like

Should be only a left or right drag, uses the x value ?

1 Like

Neither here nor there, at least it works as intended.

1 Like

So, in pursuit of the angle from rotating the steering wheel sprite, I have tried some balls! When the steering wheel is rotated, anti-clockwise (left-handed User), by dragging about it's center, balls at every 15 degrees trigger their drag event and the correct angle is reported. However, if the User then rotates the wheel clockwise or more than 360, still same drag, the balls dragging events are not triggered again. So that idea is related to a collection of balls in a well known saying....

2 Likes

I’ve been using bits and pieces of the various versions that we’ve been sharing and it’s getting closer.

I’ve given up on the 720 degrees of rotation idea as it doesn’t seem to be worth the aggravation. The wheel wants to flip 180 after it reaches 180.

Instead I’m thinking that limiting the speed of the wheel’s rotation wheel prevent the vehicle wheels from going lock-to-lock at an un realistic speed.

I’ll do a video as soon as I can pry myself out of bed.

I also wanted to share this app, that originally inspired me to go with an app, vs. a radio.

... it doesn't in my Project, because of handedness. A left hander would start on the left of the wheel, a right-hander on the right of the wheel, hence the two red dots on the image.

We're making great progress on the steering wheel and having lots of fun in the process! (that is to say, I am having fun... :grin:)

Thanks again for all your help!

I added this bit of control to reorient the wheel back to center when .Touchup is detected.

image

At first it only included the "set WHEEL . Heading to 0" blocks. Then I realized that I didn't want the wheel to SNAP back to zero.

I added the "Enabled, Interval and Speed" in an attempt to slow the wheel as it returns to the "Home" "Heading 0" but I have not been able to affect the speed that the is spinning.

I do not understand all I know about this problem...

So here is my failed version. It does snap back to zero because that was originally your request, but easy to take that feature out. Turn the wheel with thumb or finger on a red dot. If using your left-hand, tick the box.

SteeringWheel_balls.aia (72.9 KB)

Just right-mouse on this block and select "Disable Block":

DisableSnapToZero

I do want it to return. Just not so fast.

Like 180° in 1second.

You will need a timed routine (that can be interrupted if needed) that will slowly return the wheel to centre (0) from the dragged position/angle.

So I was not even in the ballpark with this rationale?

image

What if the wheel/drag speed is limited throughout the entire routine?

Just needs a Clock Timer Don:

Looks great Chris!

I'll incorporate it in the morning.

Been working on my all-wheel-drive, articulated-front-wheel, adjustable-ride-height slot car design (AUDI RS5 QUATTRO).

Have a good night!

1 Like

Good Evening,

The attached .aia represents many hours of experimentation. I am pleased to say that I am very happy with the progress so far. I have a lot of functionality yet to add but I am gaining some confidence with my application of this application application.

I just started experimenting with slowing the speed of the "TouchUp" function where the wheel returns to the initial Heading when contact with the touch screen is broken.

Can I ask if I am even close to being in the ballpark on this one?

TIA.

Don.

MAN_06.aia (612.4 KB)

Hi Don

The Clock_RestoreWheelToHome block in post #34 is the way to go about it.

1 Like

I was having trouble following/recreating the code.

I think I have it now. Except it only slows to reset speed during the clockwise ReturnToHome direction. (for both the left and right wheels). I created separate Timer, TouchUp and Dragged control blocks, Thinking the left wheel timer wasn't working, before I realized it was also only affecting the speed in the clockwise direction. So, once the wheel is rotated past 180° its return speed is no longer governed by the timer.

I'll try and figure out a solution for this after I eat some lunch. Unless you can suggest how to add this functionality.

*Wheels need to be limited to 180° rotation in both the CW/CCW directions
*Wheels need to utilize the timer function in both directions

Cheers,

MAN_06.aia (613.3 KB)