User Tools

Site Tools


common_code_v2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Last revisionBoth sides next revision
common_code_v2 [2018/07/02 13:08] – [Idle] hakcentercommon_code_v2 [2018/07/02 13:09] – [Accel Variable] hakcenter
Line 101: Line 101:
 The acceleration variable, is computed at 100ms and 10ms, and it represents the turbo rpm acceleration rate in, rpm per ms. The acceleration variable, is computed at 100ms and 10ms, and it represents the turbo rpm acceleration rate in, rpm per ms.
 <code> <code>
-  // Update turbo_accel before calculating vane_position +    //---- Calculate turbo_accel ----/
-  if (timer % 10 == 0) { +    turbo_accel = (int) (turbo_rpm - last_turbo_rpm) / 100.0f; 
-    turbo_accel[0] = (int) (turbo_rpm last_turbo_rpm[0]) 10.0f; +    last_turbo_rpm = turbo_rpm;
-    last_turbo_rpm[0] = turbo_rpm; +
-    if (timer % 100 == 0) { +
-      turbo_accel[1] = (int) (turbo_rpm - last_turbo_rpm[1]) / 100.0f; +
-      last_turbo_rpm[1] = turbo_rpm; +
-    } +
-    if (turbo_rpm < top_end_rpm) { turbo_accel[2] = turbo_accel[1]; } else { turbo_accel[2] = turbo_accel[0];+
-  }+
 </code> </code>
-\\ **<fc #6495ed>last_turbo_rpm[0]</fc>** is updated every 10ms +\\ **<fc #6495ed>last_turbo_rpm</fc>** is updated every 100ms
-\\ **<fc #6495ed>last_turbo_rpm[1]</fc>** is updated every 100ms+
 ---- ----
 ==== Idle ==== ==== Idle ====
common_code_v2.txt · Last modified: 2018/07/02 13:28 by hakcenter