woolthread.nas 515 B

123456789101112131415161718192021
  1. # Simple vibrating yawstring
  2. var yawstring = func {
  3. var airspeed = getprop("velocities/airspeed-kt");
  4. var rpm = getprop("/rotors/main/rpm");
  5. var severity = 0;
  6. if (( airspeed < 137) and (rpm >170))
  7. {
  8. severity = ( math.sin ( math.pi * airspeed/137 ) * (rand()*12) ) ;
  9. }
  10. var position = getprop("orientation/side-slip-deg") + severity ;
  11. setprop("instrumentation/yawstring",position);
  12. settimer(yawstring,0);
  13. }
  14. # Start the yawstring ASAP
  15. yawstring();