{
	"configVersion" : "1",
	"gpsConfig" : {
		"gpsInstalled" : 0,
		"startFinishTarget" : {
			"latitude" : 0,
			"longitude" : 0,
			"targetRadius" : 0.00039999998989515006542
		},
		"splitTarget" : {
			"latitude" : 0,
			"longitude" : 0,
			"targetRadius" : 0.00039999998989515006542
		},
		"latitude" : {
			"label" : "Latitude",
			"units" : "Deg",
			"sampleRate" : 10
		},
		"longitude" : {
			"label" : "Longitude",
			"units" : "Deg",
			"sampleRate" : 10
		},
		"speed" : {
			"label" : "Speed",
			"units" : "MPH",
			"sampleRate" : 10
		},
		"time" : {
			"label" : "Time",
			"units" : "Time",
			"sampleRate" : 10
		},
		"satellites" : {
			"label" : "GpsSats",
			"units" : "Ct",
			"sampleRate" : 1
		},
		"lapCount" : {
			"label" : "LapCount",
			"units" : "",
			"sampleRate" : 0
		},
		"lapTime" : {
			"label" : "LapTime",
			"units" : "seconds",
			"sampleRate" : 10
		},
		"splitTime" : {
			"label" : "SplitTime",
			"units" : "seconds",
			"sampleRate" : 0
		}
	},
	"analogConfigs" : [
		{
			"channelConfig" : {
				"label" : "Analog1",
				"units" : "Units",
				"sampleRate" : 0
			},
			"loggingPrecision" : 2,
			"linearScaling" : 0.004900000058114528656,
			"scalingMode" : 2,
			"scalingMap" : [
				{
					"raw" : 0,
					"scaled" : 7.3499999046325683594
				},
				{
					"raw" : 1023,
					"scaled" : 22.3899993896484375
				},
				{
					"raw" : 1023,
					"scaled" : 22.3899993896484375
				},
				{
					"raw" : 1023,
					"scaled" : 22.3899993896484375
				},
				{
					"raw" : 1023,
					"scaled" : 22.3899993896484375
				}
			]
		},
		{
			"channelConfig" : {
				"label" : "Analog2",
				"units" : "Units",
				"sampleRate" : 0
			},
			"loggingPrecision" : 2,
			"linearScaling" : 0.004900000058114528656,
			"scalingMode" : 1,
			"scalingMap" : [
				{
					"raw" : 0,
					"scaled" : 0
				},
				{
					"raw" : 256,
					"scaled" : 1.25
				},
				{
					"raw" : 512,
					"scaled" : 2.5
				},
				{
					"raw" : 768,
					"scaled" : 3.75
				},
				{
					"raw" : 1023,
					"scaled" : 5
				}
			]
		},
		{
			"channelConfig" : {
				"label" : "Analog3",
				"units" : "Units",
				"sampleRate" : 0
			},
			"loggingPrecision" : 2,
			"linearScaling" : 0.004900000058114528656,
			"scalingMode" : 1,
			"scalingMap" : [
				{
					"raw" : 0,
					"scaled" : 0
				},
				{
					"raw" : 256,
					"scaled" : 1.25
				},
				{
					"raw" : 512,
					"scaled" : 2.5
				},
				{
					"raw" : 768,
					"scaled" : 3.75
				},
				{
					"raw" : 1023,
					"scaled" : 5
				}
			]
		},
		{
			"channelConfig" : {
				"label" : "Coolant",
				"units" : "degC",
				"sampleRate" : 1
			},
			"loggingPrecision" : 0,
			"linearScaling" : 0.004900000058114528656,
			"scalingMode" : 2,
			"scalingMap" : [
				{
					"raw" : 22,
					"scaled" : 120
				},
				{
					"raw" : 36,
					"scaled" : 100
				},
				{
					"raw" : 61,
					"scaled" : 80
				},
				{
					"raw" : 108,
					"scaled" : 60
				},
				{
					"raw" : 194,
					"scaled" : 40
				}
			]
		},
		{
			"channelConfig" : {
				"label" : "AFRraw",
				"units" : "V",
				"sampleRate" : 0
			},
			"loggingPrecision" : 3,
			"linearScaling" : 0.004900000058114528656,
			"scalingMode" : 2,
			"scalingMap" : [
				{
					"raw" : 0,
					"scaled" : 0
				},
				{
					"raw" : 256,
					"scaled" : 1.25
				},
				{
					"raw" : 512,
					"scaled" : 2.5
				},
				{
					"raw" : 768,
					"scaled" : 3.75
				},
				{
					"raw" : 1023,
					"scaled" : 5
				}
			]
		},
		{
			"channelConfig" : {
				"label" : "OilTemp",
				"units" : "degC",
				"sampleRate" : 1
			},
			"loggingPrecision" : 0,
			"linearScaling" : 0.004900000058114528656,
			"scalingMode" : 2,
			"scalingMap" : [
				{
					"raw" : 34,
					"scaled" : 126.66699981689453125
				},
				{
					"raw" : 96,
					"scaled" : 115.555999755859375
				},
				{
					"raw" : 218,
					"scaled" : 93.33300018310546875
				},
				{
					"raw" : 280,
					"scaled" : 82.220001220703125
				},
				{
					"raw" : 435,
					"scaled" : 54.439998626708984375
				}
			]
		},
		{
			"channelConfig" : {
				"label" : "AFR",
				"units" : "AFR",
				"sampleRate" : 30
			},
			"loggingPrecision" : 2,
			"linearScaling" : 0.004900000058114528656,
			"scalingMode" : 2,
			"scalingMap" : [
				{
					"raw" : 0,
					"scaled" : 7.3499999046325683594
				},
				{
					"raw" : 1022,
					"scaled" : 22.3899993896484375
				},
				{
					"raw" : 1022,
					"scaled" : 22.3899993896484375
				},
				{
					"raw" : 1022,
					"scaled" : 22.3899993896484375
				},
				{
					"raw" : 1022,
					"scaled" : 22.3899993896484375
				}
			]
		},
		{
			"channelConfig" : {
				"label" : "Battery",
				"units" : "Volts",
				"sampleRate" : 1
			},
			"loggingPrecision" : 1,
			"linearScaling" : 0.017100000753998756409,
			"scalingMode" : 1,
			"scalingMap" : [
				{
					"raw" : 0,
					"scaled" : 0
				},
				{
					"raw" : 256,
					"scaled" : 1.25
				},
				{
					"raw" : 512,
					"scaled" : 2.5
				},
				{
					"raw" : 768,
					"scaled" : 3.75
				},
				{
					"raw" : 1023,
					"scaled" : 5
				}
			]
		}
	],
	"pulseInputConfigs" : [
		{
			"channelConfig" : {
				"label" : "RPM",
				"units" : "RPM",
				"sampleRate" : 100
			},
			"loggingPrecision" : 0,
			"slowTimer" : 0,
			"mode" : 0,
			"pulsePerRev" : 2,
			"timerDivider" : 128,
			"scaling" : 187714
		},
		{
			"channelConfig" : {
				"label" : "Wheel",
				"units" : "Hz",
				"sampleRate" : 100
			},
			"loggingPrecision" : 0,
			"slowTimer" : 0,
			"mode" : 1,
			"pulsePerRev" : 1,
			"timerDivider" : 128,
			"scaling" : 375428
		},
		{
			"channelConfig" : {
				"label" : "RPM",
				"units" : "RPM3",
				"sampleRate" : 0
			},
			"loggingPrecision" : 0,
			"slowTimer" : 0,
			"mode" : 0,
			"pulsePerRev" : 4,
			"timerDivider" : 1024,
			"scaling" : 93857
		}
	],
	"accelConfigs" : [
		{
			"channelConfig" : {
				"label" : "AccelX",
				"units" : "G",
				"sampleRate" : 30
			},
			"mode" : 1,
			"mapping" : 1,
			"zeroValue" : 2053
		},
		{
			"channelConfig" : {
				"label" : "AccelY",
				"units" : "G",
				"sampleRate" : 30
			},
			"mode" : 1,
			"mapping" : 0,
			"zeroValue" : 2049
		},
		{
			"channelConfig" : {
				"label" : "AccelZ",
				"units" : "G",
				"sampleRate" : 30
			},
			"mode" : 1,
			"mapping" : 2,
			"zeroValue" : 2034
		},
		{
			"channelConfig" : {
				"label" : "Yaw",
				"units" : "Deg_Sec",
				"sampleRate" : 30
			},
			"mode" : 1,
			"mapping" : 3,
			"zeroValue" : 1852
		}
	],
	"pulseOutputConfigs" : [
		{
			"channelConfig" : {
				"label" : "Vout1",
				"units" : "V",
				"sampleRate" : 10
			},
			"loggingPrecision" : 2,
			"outputMode" : 0,
			"loggingMode" : 2,
			"startupDutyCycle" : 100,
			"startupPeriod" : 100,
			"voltageScaling" : 0.10000000149011611938
		},
		{
			"channelConfig" : {
				"label" : "Vout2",
				"units" : "V",
				"sampleRate" : 10
			},
			"loggingPrecision" : 2,
			"outputMode" : 0,
			"loggingMode" : 0,
			"startupDutyCycle" : 100,
			"startupPeriod" : 100,
			"voltageScaling" : 0.10000000149011611938
		},
		{
			"channelConfig" : {
				"label" : "Vout3",
				"units" : "V",
				"sampleRate" : 10
			},
			"loggingPrecision" : 2,
			"outputMode" : 0,
			"loggingMode" : 1,
			"startupDutyCycle" : 100,
			"startupPeriod" : 100,
			"voltageScaling" : 0.10000000149011611938
		},
		{
			"channelConfig" : {
				"label" : "Vout4",
				"units" : "V",
				"sampleRate" : 0
			},
			"loggingPrecision" : 2,
			"outputMode" : 0,
			"loggingMode" : 0,
			"startupDutyCycle" : 50,
			"startupPeriod" : 100,
			"voltageScaling" : 0.10000000149011611938
		}
	],
	"gpioConfigs" : [
		{
			"channelConfig" : {
				"label" : "GPIO1",
				"units" : "",
				"sampleRate" : 0
			},
			"mode" : 1
		},
		{
			"channelConfig" : {
				"label" : "GPIO2",
				"units" : "",
				"sampleRate" : 0
			},
			"mode" : 1
		},
		{
			"channelConfig" : {
				"label" : "GPIO3",
				"units" : "",
				"sampleRate" : 0
			},
			"mode" : 1
		}
	],
	"outputConfig" : {
		"sdLoggingMode" : 1,
		"telemetryMode" : 0,
		"telemetryServer" : "54.245.229.2",
		"telemetryDeviceId" : "",
		"p2pDestAddrHigh" : 0,
		"p2pDestAddrLow" : 0
	},
	"connectivityConfig" : {
		"cellCfg" : {
			"apnHost" : "",
			"apnUser" : "",
			"apnPass" : ""
		},
		"btCfg" : {
			"name" : "",
			"pass" : ""
		}
	},
	"automation" : {
		"script" : "--Pin assignments--\r\n--RPM is pin 20 / PulseIn 1\r\n--set the jumpers to ON\r\n--First light is pin 6 / Vout1 10Hz 100 100 0.1 / #2 on shift light - green\r\n--Second light is pin 5 / Vout2 10Hz 100 100 0.1 / #1 on shift light - yellow\r\n--Third light is pin 4 / Vout3 10Hz 100 100 0.1 / #3 on shift light - red\r\n\r\n-- CONSTANTS --\r\nFREQ_HZ = 25  --1000*1/FREQ_HZ=loop time in ms. e.g. 25Hz=40ms--\r\nloop_time = 1000 * 1 / FREQ_HZ\r\nMAX_BLINK_PERIOD = 1000 --in ms (1s or 1000ms is reasonable value)--\r\nMAX_ON_TIME = 500 --in ms (0.5s or 500ms, half off/on is reasonable value--\r\ntestRPM = 2200  --test interface for use on bench--\r\nLL1 = 5500 --light 1 lower threshold to start blinking--\r\nUL1 = 6000 --light 1 upper threshold above which goes solid--\r\nLL2 = 6000 --light 2 lower threshold to start blinking--\r\nUL2 = 6500 --light 2 upper threshold above which goes solid--\r\nLL3 = 6500 --light 3 lower threshold to start blinking--\r\nUL3 = 7000 --light 3 upper threshold above which goes solid--\r\n-- FUNCTIONS --\r\nfunction ctON(ul,ll)\r\n\tRPM=getTimerRpm(0)\r\n\t--RPM=testRPM\r\n\tfactor = 0.5 * FREQ_HZ * (1 - (ul - RPM) / (ul - ll))\r\n\tif factor >= 0.5 * FREQ_HZ then --can't blink faster than tickRate/2--\r\n\t    \ton_time = MAX_ON_TIME\r\n\t    elseif factor < 1 then --can't blink slower than max period--\r\n\t    \ton_time = 0\r\n\t    else\r\n\t    \ton_time = MAX_ON_TIME / factor\r\n\tend\t\r\n\treturn on_time / loop_time\r\nend\r\n\r\nfunction ctMAX(ul,ll)\r\n\tRPM=getTimerRpm(0)\r\n\t--RPM=testRPM\r\n\tfactor = 0.5 * FREQ_HZ * (1 - (ul - RPM) / (ul - ll))\r\n\tblink_period = MAX_BLINK_PERIOD / factor\t\r\n\treturn blink_period / loop_time\r\nend\r\n\r\n-- Ini --\r\nsetTickRate(FREQ_HZ)\r\nj = 0\r\nk = 0\r\nl = 0\r\n-- RUN --\r\nfunction onTick()\r\n--start light 1 section--\r\n\tif j < ctON(UL1,LL1) then\r\n            \tsetAnalogOut(0,0)\r\n        else\r\n            \tsetAnalogOut(0,10) --with value of 5 measured 2.2V and dim light so set to 10, measured 4.75V\r\n\tend        \r\n\tif j < ctMAX(UL1,LL1) then\r\n\t\tj = j + 1\r\n\telse\r\n\t\tj = 0\r\n\tend\r\n--end light 1 section--\r\n--start light 2 section--\r\n\tif k < ctON(UL2,LL2) then\r\n            \tsetAnalogOut(1,0)\r\n        else\r\n            \tsetAnalogOut(1,10) --with value of 5 measured 2.2V and dim light so set to 10, measured 4.75V\r\n\tend        \r\n\tif k < ctMAX(UL2,LL2) then\r\n\t\tk = k + 1\r\n\telse\r\n\t\tk = 0\r\n\tend\r\n--end light 2 section--\r\n--start light 3 section--\r\n\tif l < ctON(UL3,LL3) then\r\n            \tsetAnalogOut(2,0)\r\n        else\r\n            \tsetAnalogOut(2,10) --with value of 5 measured 2.2V and dim light so set to 10, measured 4.75V\r\n\tend        \r\n\tif l < ctMAX(UL3,LL3) then\r\n\t\tl = l + 1\r\n\telse\r\n\t\tl = 0\r\n\tend\r\n--end light 3 section--\r\nend"
	}
}