View racecapture_CAN_loopback.lua
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) |
View pct_gsum_max_calculator.lua
-- 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 |
View shiftx3_controlling_secondary.lua
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) |
View ShiftX3_simulator_with_virtual_channels.lua
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 |
View gist:488a78d8f558c223e1634226dd8f07b6
// 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(); |
View RaceCapture_simple_Lua_CAN_bus_analyzer.lua
-- 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 |
View ShiftX3_test.lua
sxCan = 1 | |
sxId=0 | |
tickRate=30 | |
sxBright=0 | |
disp = 0 | |
function rndc() | |
return math.random(0,255) | |
end |
View test_virtual_channels.lua
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 |
View RX8_manual_PID_query_engine_temp_fuel_level.lua
--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 |
View pred_time_simulator_time_delta.lua
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