<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.autosportlabs.com/index.php?action=history&amp;feed=atom&amp;title=RaceCapturePro2_ShiftLights</id>
	<title>RaceCapturePro2 ShiftLights - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.autosportlabs.com/index.php?action=history&amp;feed=atom&amp;title=RaceCapturePro2_ShiftLights"/>
	<link rel="alternate" type="text/html" href="https://wiki.autosportlabs.com/index.php?title=RaceCapturePro2_ShiftLights&amp;action=history"/>
	<updated>2026-10-12T01:47:35Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://wiki.autosportlabs.com/index.php?title=RaceCapturePro2_ShiftLights&amp;diff=5847&amp;oldid=prev</id>
		<title>Brentp: initial edit</title>
		<link rel="alternate" type="text/html" href="https://wiki.autosportlabs.com/index.php?title=RaceCapturePro2_ShiftLights&amp;diff=5847&amp;oldid=prev"/>
		<updated>2014-12-19T19:48:25Z</updated>

		<summary type="html">&lt;p&gt;initial edit&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=Sequential Shift light=&lt;br /&gt;
&lt;br /&gt;
One way to enable shift light is by using the PWM / Analog output channels to trigger a 3 + 1 shift light output. In this case, we used 3 of the outputs to control the 3 LED segments on the [[Sequential_shift_light|ShiftX Sequential Shift Light]] display, and the 4th output controls a focused Red LED that flashes at the top end of the RPM range.&lt;br /&gt;
&lt;br /&gt;
* Example Video:&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=n-eT5V1_8uc&amp;amp;list=UU4Gu8BDjcUjAL8v80Ukluqg Video]&lt;br /&gt;
&lt;br /&gt;
=Script=&lt;br /&gt;
==Requirements==&lt;br /&gt;
* A working RPM signal connected to the first timer input channel on RaceCapture/Pro. &lt;br /&gt;
* Shift light boards connected to PWM / Analog out 1 - 3; flash alert LED to the 4th output&lt;br /&gt;
&lt;br /&gt;
 --[[ &lt;br /&gt;
 &lt;br /&gt;
 3 stage + 1 sequential shift light&lt;br /&gt;
 &lt;br /&gt;
 Input &lt;br /&gt;
 Timer 0 - RPM &lt;br /&gt;
 &lt;br /&gt;
 Tach Lights &lt;br /&gt;
 0 - Green Light &lt;br /&gt;
 1 - Yellow Light &lt;br /&gt;
 2 - Red Light&lt;br /&gt;
 3 - Flash alert &lt;br /&gt;
 ]] &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 -- Globals -- &lt;br /&gt;
 LIGHTS = 4 &lt;br /&gt;
 LIGHT_VALS = {} &lt;br /&gt;
 FREQUENCY_HZ = 10 &lt;br /&gt;
 &lt;br /&gt;
 -- Global Init -- &lt;br /&gt;
 setTickRate(FREQUENCY_HZ) &lt;br /&gt;
 &lt;br /&gt;
 function toggleLight(index) &lt;br /&gt;
    LIGHT_VALS[index] = not LIGHT_VALS[index] &lt;br /&gt;
 end &lt;br /&gt;
 &lt;br /&gt;
 function lightOn(index) &lt;br /&gt;
    LIGHT_VALS[index] = true &lt;br /&gt;
 end &lt;br /&gt;
 &lt;br /&gt;
 function lightOff(index) &lt;br /&gt;
    LIGHT_VALS[index] = false &lt;br /&gt;
 end &lt;br /&gt;
 &lt;br /&gt;
 local lCount = 0 &lt;br /&gt;
 repeat &lt;br /&gt;
    lightOff(lCount) &lt;br /&gt;
    lCount = lCount + 1 &lt;br /&gt;
 until lCount &amp;gt;= LIGHTS &lt;br /&gt;
 &lt;br /&gt;
 -- Script -- &lt;br /&gt;
 function updateLights() &lt;br /&gt;
    local l = 0 &lt;br /&gt;
    repeat &lt;br /&gt;
       -- Convert our booleans to 1 (true) or 0 (false) -- &lt;br /&gt;
       local val = LIGHT_VALS[l] &lt;br /&gt;
       local dc = 0 &lt;br /&gt;
       if not val then &lt;br /&gt;
          dc = 100 &lt;br /&gt;
       end &lt;br /&gt;
       setPwmDutyCycle(l, dc) &lt;br /&gt;
 &lt;br /&gt;
       l = l + 1 &lt;br /&gt;
    until l &amp;gt;= LIGHTS &lt;br /&gt;
 end &lt;br /&gt;
 &lt;br /&gt;
 function checkRpm() &lt;br /&gt;
    local rpm = getTimerRpm(0) &lt;br /&gt;
    if rpm &amp;lt; 3000 then &lt;br /&gt;
         lightOff(0) &lt;br /&gt;
         lightOff(1) &lt;br /&gt;
         lightOff(2) &lt;br /&gt;
         lightOff(3) &lt;br /&gt;
    elseif 3000 &amp;lt; rpm and rpm &amp;lt; 4500 then &lt;br /&gt;
         lightOn(0) &lt;br /&gt;
         lightOff(1) &lt;br /&gt;
         lightOff(2) &lt;br /&gt;
         lightOff(3)&lt;br /&gt;
    elseif 4500 &amp;lt; rpm and rpm &amp;lt; 5000 then &lt;br /&gt;
         lightOn(0) &lt;br /&gt;
         lightOn(1) &lt;br /&gt;
         lightOff(2)&lt;br /&gt;
         lightOff(3) &lt;br /&gt;
    elseif 5000 &amp;lt; rpm and rpm &amp;lt; 5500 then &lt;br /&gt;
         lightOn(0) &lt;br /&gt;
         lightOn(1) &lt;br /&gt;
         lightOn(2)&lt;br /&gt;
         lightOff(3) &lt;br /&gt;
    else &lt;br /&gt;
         toggleLight(3) &lt;br /&gt;
    end &lt;br /&gt;
 end &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 function controlLights() &lt;br /&gt;
    checkRpm() &lt;br /&gt;
    updateLights() &lt;br /&gt;
 end &lt;br /&gt;
 &lt;br /&gt;
 -- Start! &lt;br /&gt;
 &lt;br /&gt;
 function onTick() &lt;br /&gt;
    controlLights() &lt;br /&gt;
 end&lt;/div&gt;</summary>
		<author><name>Brentp</name></author>
	</entry>
</feed>