Skip to content

Instantly share code, notes, and snippets.

Brent Picasso brentpicasso

Block or report user

Report or block brentpicasso

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@brentpicasso
brentpicasso / e46_expanded_channels.lua
Last active Jan 26, 2016
E46 expanded channels using 2.8.7 firmware and bitOp library
View e46_expanded_channels.lua
--This example configured for E46 CAN
-- Automatically starts logging with engine 'on' (RPM triggered)
--how frequently we poll for CAN messages
tickRate = 30
--the CAN baud rate
CAN_baud = 500000
--CAN channel to listen on. 0=first CAN channel, 1=second
CAN_chan = 0
--add your virtual channels here
@brentpicasso
brentpicasso / E46_CAN_simulator.lua
Created Jan 25, 2016
Simulator script for E46
View E46_CAN_simulator.lua
setTickRate(30)
function encodeWheel(value)
low_byte = bit.band(value, 0xFF)
high_byte = bit.rshift(bit.band(value, 0x1F00), 5)
return low_byte, high_byte
end
lf_wheel = 0
rf_wheel = 0
@brentpicasso
brentpicasso / E46_debugging.lua
Last active Jan 26, 2016
Adding raw low / high byte debugging for wheel speeds
View E46_debugging.lua
--This example configured for E46 CAN
-- Automatically starts logging with engine 'on' (RPM triggered)
--how frequently we poll for CAN messages
tickRate = 30
--the CAN baud rate
CAN_baud = 500000
--CAN channel to listen on. 0=first CAN channel, 1=second
CAN_chan = 0
--add your virtual channels here
@brentpicasso
brentpicasso / lapping_simulator_with_pit_stops.lua
Last active Nov 3, 2017
Lapping simulator with pit stops
View lapping_simulator_with_pit_stops.lua
--this script adequately simulates varying speeds and periodic pit stops
--disable all GPS channels
--disable lap timing
dist = 0
speed = 30
speedDir = 0
maxSpeedDir = 2
minSpeedDir = -2
lapCount = 0
currentLap = 1
View RPM simulator
--RPM simulator!
rpm = 0
rpmDir = 100
maxRpm = 10000
rpmId = addChannel("RPM", 10, 0, 0, 10000)
setTickRate(50)
function onTick()
setChannel(rpmId, rpm)
rpm=rpm + rpmDir
@brentpicasso
brentpicasso / gist:d9fbf7dd44e010651bccbad910d290a4
Last active Jul 14, 2016
Trailing average for an sensor channel
View gist:d9fbf7dd44e010651bccbad910d290a4
fuel2Id = addChannel("Fuel2", 25, 2, 0,10,"%")
--change this to make a bigger averaging window
--300 = 10 seconds averaging at 30Hz tick rate
maxAvg = 300
fuelAvg={}
fuel2Index = 1
function updateFuel2(value)
local i
@brentpicasso
brentpicasso / all_sample_rates.rcp
Last active Nov 6, 2016
All possible sample rate combinations for RaceCapture/Pro - for testing. save this as a RCP configuration file (all_sample_rates.rcp)
View all_sample_rates.rcp
{
"rcpCfg": {
"analogCfg": {
"0": {
"alpha": 1.0,
"map": {
"raw": [
0.0,
1.25,
2.5,
@brentpicasso
brentpicasso / gist:247d898f369cfb731e0014bb6f9dcb3c
Created Dec 12, 2016
Create Random tire and brake temperature data for RaceCapture/Pro
View gist:247d898f369cfb731e0014bb6f9dcb3c
tires = 4
tireZones = 4
tirePrefixes = {'TireTmpFL', 'TireTmpFR', 'TireTmpRL', 'TireTmpRR'}
tireValues = {}
tireIds = {}
minTireVal = 0
maxTireVal = 300
brakes = 4
brakeZones = 4
@brentpicasso
brentpicasso / gist:c584c192e45453facdad8a36b7b06470
Created Dec 12, 2016
Simulated tire and brake temperature data based on g-force readings.
View gist:c584c192e45453facdad8a36b7b06470
--Note, If 2.10.2 firmware, AccelX and AccelY need to be inverted in the RCP configuration.
tires = 4
tireZones = 4
tirePrefixes = {'TireTmpFL', 'TireTmpFR', 'TireTmpRL', 'TireTmpRR'}
tireValues = {}
tireIds = {}
minTireVal = 0
maxTireVal = 300
@brentpicasso
brentpicasso / tire_temp_simulator.lua
Last active Oct 22, 2018
Simulated tire and brake temperature data based on g-force readings.
View tire_temp_simulator.lua
--Note, If 2.10.2 firmware, AccelX and AccelY need to be inverted in the RCP configuration.
tires = 4
tireZones = 4
tirePrefixes = {'TireTmpFL', 'TireTmpFR', 'TireTmpRL', 'TireTmpRR'}
tireValues = {}
tireIds = {}
minTireVal = 0
maxTireVal = 300
You can’t perform that action at this time.