This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val = 0 | |
-- transmit on CAN1 and receive on CAN2 | |
function onTick() | |
--transmit value on CAN1 | |
txCAN(0, 1234, 0, {val}) | |
--receive on CAN2 | |
id, e, data = rxCAN(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Calculates and tracks how much of your maximum grip you are using, in real-time | |
setTickRate(25) | |
maxGsumId = addChannel("MaxGsum", 25, 2, -2.0, 2.0) | |
pctGsumMaxId = addChannel("PctMaxGsum", 25, 0, 0, 100) | |
maxGsum = 0 | |
function updateGsumStats() | |
local gsum = getChannel("Gsum") | |
if gsum ~= nil and gsum > 0 then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setTickRate(30) | |
-- Set ShiftX3 configuration parameters with default parameters | |
-- orientation: 0=normal, 1=inverted (display above LED bar) | |
-- brightness: 0-100%, 0 = auto brightness | |
-- can bus: 0=CAN1, 1=CAN2 | |
sxSetConfig(0,0,1) | |
--create gear channel | |
gearId = addChannel("Gear", 10, 0, 0, 6) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setTickRate(30) | |
-- Set ShiftX3 configuration parameters with default parameters | |
-- orientation: 0=normal, 1=inverted (display above LED bar) | |
-- brightness: 0-100%, 0 = auto brightness | |
-- can bus: 0=CAN1, 1=CAN2 | |
sxSetConfig(0,0,1) | |
--config shift light | |
sxCfgLinearGraph(0,0,0,10000) --left to right graph, smooth style, 0 - 7000 RPM range |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Prevent sleep | |
[NSTimer scheduledTimerWithTimeInterval:2.0 repeats:YES block: ^(NSTimer * _Nonnull timer) { | |
[UIApplication sharedApplication].idleTimerDisabled = NO; | |
[UIApplication sharedApplication].idleTimerDisabled = YES; | |
NSLog(@"idle timer"); | |
}]; | |
NSLog(@"Initializing python"); | |
Py_Initialize(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Simple CAN bus analyzer | |
-- This script is useful for reverse engineering CAN bus data | |
-- and detecting patterns. | |
-- | |
-- Up to 100 individual 8 bit channels can be created. Additional channels will not be tracked. | |
-- CAN bus data will appear in the data stream with the channel name: <CAN ID>_<OFFSET> | |
-- Once script is running, you can monitor the data under Dashboard / Raw Channels View. | |
---------------------------------------- | |
--Configuration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sxCan = 1 | |
sxId=0 | |
tickRate=30 | |
sxBright=0 | |
disp = 0 | |
function rndc() | |
return math.random(0,255) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
maxEt = 300 | |
maxOt = 300 | |
etId = addChannel("EngineTemp", 10, 0, 0, maxEt) | |
otId = addChannel("OilTemp", 10, 0, 0, maxOt) | |
et = 0 | |
ot = 0 | |
setTickRate(50) | |
function onTick() | |
et=et+1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Implements a simple OBDII engine in lua scripting, with a configurable delay between PIDs. | |
-- IMPORTANT: Ensure built-in OBDII is turned off in Setup | |
-- | |
--500K baud. set your baud rate here. | |
initCAN(0, 500000) | |
--standard 11 bit PID request 0x7DF | |
--extended 29 bit PID request 0x18DB33F1 | |
--standard 11 bit PID response 0x7E8 | |
--extended 29 bit PID response 0x18DAF110 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setTickRate(2) | |
delta = 0 | |
dir = 0.05 | |
did = addChannel('TimeDelta2', 50, 2, -10, 10, 'sec') | |
pid = addChannel('PredTime', 10, 4, 0, 5, 'min') | |
clid = addChannel('CurrentLap', 50, 0) | |
lcid = addChannel('LapCount', 50, 0) | |
NewerOlder