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
--this script adequately simulates varying speeds and periodic pit stops | |
--disable all GPS channels | |
--disable lap timing | |
shiftx_can = 1 | |
shiftx_id = 0xE3700 | |
dist = 0 | |
speed = 30 | |
speedDir = 0 | |
maxSpeedDir = 2 |
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
slcan = 1 | |
function splitWord(value) | |
return bit.band(value, 0xFF), bit.rshift(bit.band(value, 0xFF00),8) | |
end | |
function sl_cfgAlert(id, threshId, threshold, red, green, blue, flash) | |
local lowt | |
local hight | |
lowt, hight = splitWord(threshold) | |
txCAN(slcan, 744389 + 12, 1, {id, threshId, lowt, hight, red, green, blue, flash}) |
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
shiftx_can = 1 | |
shiftx_id = 0xE3700 | |
function shiftx_tx(offset, data) | |
txCAN(shiftx_can, shiftx_id + offset, 1, data) | |
sleep(10) | |
end | |
function splitWord(value) | |
return bit.band(value, 0xFF), bit.rshift(bit.band(value, 0xFF00),8) | |
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
function splitWord(value) | |
return bit.band(value, 0xFF), bit.rshift(bit.band(value, 0xFF00),8) | |
end | |
function setLinearThreshold(id, threshold, red, green, blue, flash) | |
local lowt | |
local hight | |
lowt, hight = splitWord(threshold) | |
txCAN(0, 744389 + 15, 1, {id, 0, lowt, hight, red, green, blue, flash}) |
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
shiftx_can = 1 | |
shiftx_id = 0xE3700 | |
function shiftx_tx(offset, data) | |
txCAN(shiftx_can, shiftx_id + offset, 1, data) | |
sleep(10) | |
end | |
function splitWord(value) | |
return bit.band(value, 0xFF), bit.rshift(bit.band(value, 0xFF00),8) | |
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
function splitWord(value) | |
return bit.band(value, 0xFF), bit.rshift(bit.band(value, 0xFF00),8) | |
end | |
function setLinearThreshold(id, threshold, red, green, blue, flash) | |
local lowt | |
local hight | |
lowt, hight = splitWord(threshold) | |
txCAN(0, 744389 + 15, 1, {id, 0, lowt, hight, red, green, blue, flash}) |
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) | |
initCAN(0, 500000) | |
txCAN(0, 744389 + 12, 1, {0, 0, 5, 0, 0 , 255, 0, 0}) | |
sleep(10) | |
txCAN(0, 744389 + 12, 1, {0, 1, 20, 0, 255, 0 , 0, 0}) | |
sleep(10) | |
txCAN(0, 744389 + 12, 1, {1, 0, 5, 0, 0 , 255, 0, 0}) | |
sleep(10) |
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) | |
initCAN(0, 500000) | |
txCAN(0, 744389 + 10, 1, {0, 9, 0,0,0,5}) | |
leds = 7 | |
function onTick() | |
local x = getImu(3) / 10 | |
local l = math.floor(math.abs(x)) | |
if l > leds then l = leds 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
--Note, If 2.10.2 firmware, AccelX and AccelY need to be inverted in the RCP configuration. | |
tires = 4 | |
tireZones = 4 | |
tirePrefixes = {'TireTmpLF', 'TireTmpRF', 'TireTmpLR', 'TireTmpRR'} | |
tireValues = {} | |
tireIds = {} | |
minTireVal = 0 | |
maxTireVal = 300 |
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
--Note, If 2.10.2 firmware, AccelX and AccelY need to be inverted in the RCP configuration. | |
tires = 4 | |
tireZones = 4 | |
tirePrefixes = {'TireTmpLF', 'TireTmpRF', 'TireTmpLR', 'TireTmpRR'} | |
tireValues = {} | |
tireIds = {} | |
minTireVal = 0 | |
maxTireVal = 300 |