We are using the function getDateTime() successfully to automatically lower the intensity of the Three Stage Sequential Shift Light, which may be a problem when racing at night (too bright), but is perfect during the day.
Perhaps an example of how it is called may help others:
Year, Month, Day, Hour, Min, Second, Mil = getDateTime()
Hour = Hour + TZONE
if (Hour < 7 or Hour > 17) then
Intensity = LOW
else
Intensity = HIGH
end
We set TZONE as negative number in comparison to UTC (-5 in Miami), and use Intensity to adjust voltage when calling setAnalogOut. HIGH was set at 0 and LOW at 4.5 (lowest it actually lights up).
There is an error in the documentation as the return value Minute is missing.
Using getDateTime()
Shift light auto intensity and BMW E30
It is possible to lower intensity even more, if you find that 4.5v is still too bright at night, by setting the analog channel frequency higher. One starts noticing more dimming above 25000 Hz.
To do that add:
setPwmClockFreq(LightFQ)
Make LightFQ = 25000 and above.
Perhaps it is possible to also use (I haven't tried that yet)
setPwmDutyCycle( channel, dutyCyclePct )
and lower the dutyCycle % to dim, so that you can control each light intensity individually.
I set up a BMW E30 with RPM, oil pressure, coolant temp, shift lights, gear position, break pedal, throttle pedal and gas level as well as a neat way to use the shift lights also as alarms. I removed the dashboard completely and replaced it with a Galaxy 10. It works great. I will post detailed instructions on sensors and lua code in January after endurance testing at a Chumcar race at Sebring.
To do that add:
setPwmClockFreq(LightFQ)
Make LightFQ = 25000 and above.
Perhaps it is possible to also use (I haven't tried that yet)
setPwmDutyCycle( channel, dutyCyclePct )
and lower the dutyCycle % to dim, so that you can control each light intensity individually.
I set up a BMW E30 with RPM, oil pressure, coolant temp, shift lights, gear position, break pedal, throttle pedal and gas level as well as a neat way to use the shift lights also as alarms. I removed the dashboard completely and replaced it with a Galaxy 10. It works great. I will post detailed instructions on sensors and lua code in January after endurance testing at a Chumcar race at Sebring.