How would you make a double tap type thing?
Like. hit and hold space it goes up while olding space. Else hit space then hit space again and hold it goes down?
And something like...
if A then forward
if A then B forward and Up
If B then A up only
I don't quite understand what you mean?i could really use the clock thing on the gate if sumone could reword it[/b]
You don't understand what "we" say on how to use it?
How would you make a double tap type thing?
Like. hit and hold space it goes up while olding space. Else hit space then hit space again and hold it goes down?
And something like...
if A then forward
if A then B forward and Up
If B then A up only
Depends on the restrictions:
That should work, mode is either 0 (off), 1 (hold), 2 (double tap).Code:~Tap & !Tap & !St -> Mode = 0; ~Tap & Tap & St -> St = 0, Mode = 2; ~Tap & Tap & !St -> St = 1, schedule(50); clk() & St -> St = 0, Mode = 1;
mm.. I see... Never thought of using ~.Depends on the restrictions:
That should work, mode is either 0 (off), 1 (hold), 2 (double tap).[/b]Code:~Tap & !Tap & !St -> Mode = 0; ~Tap & Tap & St -> St = 0, Mode = 2; ~Tap & Tap & !St -> St = 1, schedule(50); clk() & St -> St = 0, Mode = 1;
Thanks.
I think I am being too much of a perfectionist with this hover system thing that tilts haha.
Edit. I does not work right.I dunno what it is doing .
Here's what I doing:
Z is the Z offset from a beacon sensor, Height is a ranger aimed below this contraption, and Target is a Target finder.Code:N@BOTHOvering I@On Z Height Target O@Hovermode ZVelocity SPD = 3 #Max speed for hover-balls HTK = 30 #Height to keep from ground HDF = 40 #Height difference from target AJH = Z + HDF Hovermode = On !On -> ZVelocity = 0; On & Target -> Height > HTK -> ZVelocity = clamp(AJH, -SPD, SPD); Height < HTK & AJH < 0 -> ZVelocity = clamp((HTK - Height), -SPD, SPD); Height < HTK & AJH > 0 -> ZVelocity = clamp(AJH, -SPD, SPD);; On & !Target -> ZVelocity = clamp((HTK - Height), -SPD, SPD);
I set up several statements in there.
1. Is the contraption above its "low" point (HTK)? If so, go wild after the target (ZVelocity = clamp(AJH, -SPD, SPD))
2. Is the contraption too low, and is the target demanding the contraption go lower? If so, just worry about how low you are (ZVelocity = clamp((HTK - Height), -SPD, SPD)).
3. Is the contraption too low, but is the target demanding you rise? If so, go nuts after the target (ZVelocity = clamp(AJH, -SPD, SPD)).
4. Is there no target? If so, just worry about staying off of the ground (ZVelocity = clamp((HTK - Height), -SPD, SPD)).
Now, I have done this before and I know exactly what will happen. The hover-balls aren't quite as easy to finesse as thrusters, so to get them to slow down and stop within a certain area I usually have to set up a "cushion range". Using that cushion range, I divide the speed they are moving by some number to steadily decrease the movement until they completely stop.
Something like this:
Which has worked in the past, but for 4 statements, creating cushion ranges for all of them seems a bit nutty.Code:CR = HTK / 10 Height > HTK + CR -> ZVelocity = -SPD; Height < HTK - CR -> ZVelocity = SPD; Height > HTK - CR & Height > HTK - CR & -> ZVelocity = (HTK - Height) / (CR - 1);
So is there a way of merging the two, using clamp() instead of two statements, and using the last line as a sort of override? Also, is there a simple statement that outputs a 1 if a value is within a set value boundry (Is Blah between X and Y? instead of Is Blah less than X AND greater than Y?)?
Not quite sure what you mean.So is there a way of merging the two, using clamp() instead of two statements, and using the last line as a sort of override?[/b]
Nope, could be pretty useful with such a function actually, no there is currently no such function but I might add a one later.Also, is there a simple statement that outputs a 1 if a value is within a set value boundry (Is Blah between X and Y? instead of Is Blah less than X AND greater than Y?)?[/b]
A = B > X & B < Y is the way to do it now, as you say.
I dig using the clamp() function to set the speeds. However, if I only use the clamp() I get the silly wobbling bit. If I use a cushion range, I use three lines (Value < -X, Value > X, and Value < X & Value > -X). Can I just use the clamp() and then have "Value < X & Value > -X" override it somehow?Not quite sure what you mean.[/b]
It really isn't *that* big of a deal, but I'd like to consolidate as much as I possibly can.
What would be perfect is if the range() or boundary() or whatever was a function and I could do something like
Code:On -> !range(Value, -X, X) -> clamp(Value, l, u); range(Value, -X, X) -> #othercode;;
Hey how would I do a square root with the + & - ontop of each other and in front of the sqrt symbol?
also, a sin-1 is just sin^-1 right?
First time I've actually asked for advice in expressions.
I am working on perfecting the wire-gyro-engine and was wondering if there was a good way to use the internal timer together with the internal delta to find a good RPM.
I am not so good with the internal timer yet, so I am asking for advise.
This is what I have so far, 20*50=1000=1 second, $Roll*60/360=RPM. Plus smoothed it out.Code:N@SH Engine I@Roll ERoll O@RPM interval(20) clk() -> RPM=RPM*0.8+angnorm($ERoll-$Roll)*0.2*(50*60/360)
Would this create RPM, or is there a far better way?
And is there a way to get readings faster through an expression, because I need to get faster calculations to increase the speed of my engines that has maxed out at "angnorm($Roll)=148" and I want my engine to be faster still. I can quess that its the speed of the readings and calculations that is holding my engine back.
Everything can be improved upon. Nothing is Perfect.
The only way to move forward, is to surpass what has already been done.
Creator of many things.
The +/- symbol actually means you have two possible solutions. In fact, you commonly find them in front of a square root symbol because of its nature.Hey how would I do a square root with the + & - ontop of each other and in front of the sqrt symbol?
also, a sin-1 is just sin^-1 right?[/b]
If you need to deal with it, the only way (both in programming and in written math) is to split it up into two equations: one with a plus and one with a minus.
x* x+ 17 = 0
When keeping it real goes wrong.
Bookmarks