Skip to content

Commit a4f23cc

Browse files
author
Turnermator13
committed
version 2.0.22 released, some work on default com port for iRacing client
1 parent f906af9 commit a4f23cc

File tree

17 files changed

+113
-51
lines changed

17 files changed

+113
-51
lines changed

ArduinoDash/ArduinoDash.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define STB 9
1212

1313

14-
PROGMEM prog_uchar VERSION[] = {2, 0, 2, 0};
14+
PROGMEM prog_uchar VERSION[] = {2, 0, 2, 2};
1515
PROGMEM prog_uint16_t ledsLong[2][17] = {{0, 1, 3, 7, 15, 31, 63, 127, 255, 256, 768, 1792, 3840, 7936, 7968, 8032, 8160}, {0, 1, 3, 7, 15, 31, 63, 127, 255, 1, 3, 7, 15, 31, 8223, 24607, 57375}};
1616
PROGMEM prog_uint16_t ledsShort[2][9] = {{0, 256, 768, 1792, 3840, 7936, 7968, 8032, 8160}, {0, 1, 3, 7, 15, 31, 8223, 24607, 57375}};
1717

Changelog.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
Arduino Racing Dash ChangeLog
22
--------------------
33

4+
v2.0.22:
5+
Added OPTIONAL brake vibration on brake lockup
6+
Rewrote iRacing client
7+
48
v2.0.17:
59
Fix Reliant Robin Incompatibility
610

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
##Arduino Racing Dashboard
2-
**Latest Version:** v2.0.11 - Tested for Asseto Corsa v1.0 RC
2+
**Latest Version:** v2.0.22 - Tested for Asseto Corsa v1.0 RC
33

44
Dashboard code for TM1638 module linked to an Arduino, support for Asseto Corsa and iRacing currently
55

acSLI/acSLIApp/app.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#################
1313
Version = "2.0.22"
14-
ArduinoVersion = "2.0.20"
14+
ArduinoVersion = "2.0.22"
1515
#################
1616

1717
Log = Logger()
@@ -175,6 +175,7 @@ def estimateFuel(self):
175175

176176
self.prevFuel = self.simInfo.physics.fuel
177177

178+
#Thanks to Stephane Turpin for locking algorithm
178179
def calcBrakeVibe(self):
179180
speed = ac.getCarState(0, acsys.CS.SpeedMS)
180181
rpm = ac.getCarState(0, acsys.CS.RPM)

iRacingSLI/iRacingSLI.exe

1 KB
Binary file not shown.

iRacingSLI/src/iRacingSLI.v12.suo

512 Bytes
Binary file not shown.
1 KB
Binary file not shown.
2 KB
Binary file not shown.

iRacingSLI/src/iRacingSLI/brakeVibe.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public brakeVibe()
1717

1818
}
1919

20+
//Thanks to Stephane Turpin for locking algorithm
2021
public int getBrakeVibe(TelemetryInfo telem, int trkTol, int trkSens){
2122
speed = Convert.ToDouble(telem.Speed.Value);
2223
rpm = Convert.ToDouble(telem.RPM.Value);

iRacingSLI/src/iRacingSLI/connectionHelper.cs

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@ public connectionHelper(Action<String> callConsole)
2323
open = false;
2424
}
2525

26-
public void setupConnection(Action<String> startMethod, System.Windows.Forms.ComboBox cbo)
26+
public void setupConnection(Action<String> startMethod, System.Windows.Forms.ComboBox cbo, configHandler cfg)
2727
{
2828
Object[] arrayPorts = null;
29-
int startPort = 0;
29+
int startPort = -1;
30+
String setting = cfg.readSetting("Port", "*");
3031
using (var searcher = new ManagementObjectSearcher("SELECT * FROM WIN32_SerialPort"))
3132
{
3233
string[] portnames = SerialPort.GetPortNames();
@@ -35,21 +36,43 @@ public void setupConnection(Action<String> startMethod, System.Windows.Forms.Com
3536
}
3637
cbo.Items.AddRange(arrayPorts);
3738

38-
for (int i = 0; i < cbo.Items.Count; i++)
39+
if (setting != "*")
3940
{
40-
if (cbo.Items[i].ToString().Contains("Arduino"))
41+
for (int j = 0; j < SerialPort.GetPortNames().Length; j++)
4142
{
42-
String port = Regex.Match(cbo.Items[i].ToString(), @"\(([^)]*)\)").Groups[1].Value;
43-
console("Found Arduino On Port: " + port);
44-
startMethod(port);
45-
46-
for (int j = 0; j < SerialPort.GetPortNames().Length; j++)
43+
if (SerialPort.GetPortNames()[j].Equals(setting))
4744
{
48-
if (SerialPort.GetPortNames()[j].Equals(port))
45+
try
46+
{
47+
startMethod(setting);
4948
startPort = j;
49+
}
50+
catch{
51+
cfg.writeSetting("Port", "*");
52+
}
5053
}
54+
}
55+
if (startPort == -1)
56+
cfg.writeSetting("Port", "*");
57+
}
58+
else
59+
{
60+
for (int i = 0; i < cbo.Items.Count; i++)
61+
{
62+
if (cbo.Items[i].ToString().Contains("Arduino"))
63+
{
64+
String port = Regex.Match(cbo.Items[i].ToString(), @"\(([^)]*)\)").Groups[1].Value;
65+
console("Found Arduino On Port: " + port);
66+
startMethod(port);
5167

52-
break;
68+
for (int j = 0; j < SerialPort.GetPortNames().Length; j++)
69+
{
70+
if (SerialPort.GetPortNames()[j].Equals(port))
71+
startPort = j;
72+
}
73+
74+
break;
75+
}
5376
}
5477
}
5578
cbo.SelectedIndex = startPort;

0 commit comments

Comments
 (0)