Skip to content

Commit

Permalink
Merge pull request #24 from ChrGri/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
ChrGri authored Feb 20, 2024
2 parents ba3ebef + f215334 commit 620ee4b
Show file tree
Hide file tree
Showing 40 changed files with 193,645 additions and 79,280 deletions.
8 changes: 7 additions & 1 deletion Arduino/Esp32/Main/Main.ino
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,12 @@ void setup()

// check whether iSV57 is connected
isv57LifeSignal_b = isv57.checkCommunication();
if (!isv57LifeSignal_b)
{
Serial.println( "Restarting ESP" );
ESP.restart();
}


Serial.print("iSV57 communication state: ");
Serial.println(isv57LifeSignal_b);
Expand Down Expand Up @@ -279,7 +285,7 @@ void setup()
#endif

// find the min & max endstops

Serial.print("Start homing");
if (isv57LifeSignal_b && SENSORLESS_HOMING)
{
stepper->findMinMaxSensorless(&isv57);
Expand Down
2 changes: 2 additions & 0 deletions Arduino/Esp32/arduinoCliBuildScript_speedcrafter_PCB_V1p4.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
arduino-cli compile --fqbn esp32:esp32:esp32wrover --output-dir ./Arduino/Esp32/bin_speedcrafter_PCB_V1p4 --libraries ./Arduino/libs/ --build-property build.extra_flags=-DPCB_VERSION=5 ./Arduino/Esp32/Main

Binary file added Arduino/Esp32/bin.zip
Binary file not shown.
Binary file modified Arduino/Esp32/bin/Main.ino.bin
Binary file not shown.
Binary file modified Arduino/Esp32/bin/Main.ino.elf
Binary file not shown.
152,018 changes: 76,476 additions & 75,542 deletions Arduino/Esp32/bin/Main.ino.map

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
112,833 changes: 112,833 additions & 0 deletions Arduino/Esp32/bin_speedcrafter_PCB_V1p4/Main.ino.map

Large diffs are not rendered by default.

Binary file not shown.
437 changes: 437 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,17 @@ This repository documents my research progress. I wanted to understand the neces

The FFB pedal is a robot and can be dangerous. Please watch [The Terminator](https://en.wikipedia.org/wiki/The_Terminator) before continuing. If not interacted with care, it may cause harm. I'm not responsible for any harm caused by this design suggestion. Use responsibly and at your own risk.

# License
Shield: [![CC BY-NC-SA 4.0][cc-by-nc-sa-shield]][cc-by-nc-sa]

This work is licensed under a
[Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License][cc-by-nc-sa].

[![CC BY-NC-SA 4.0][cc-by-nc-sa-image]][cc-by-nc-sa]

[cc-by-nc-sa]: http://creativecommons.org/licenses/by-nc-sa/4.0/
[cc-by-nc-sa-image]: https://licensebuttons.net/l/by-nc-sa/4.0/88x31.png
[cc-by-nc-sa-shield]: https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-lightgrey.svg

# Features
## Control of pedal parameters
Expand All @@ -30,6 +40,15 @@ The joystick/gamepad data is provided via three redundant channels
[![IMAGE ALT TEXT HERE](https://img.youtube.com/vi/i2e1ukc1ylA/0.jpg)](https://www.youtube.com/watch?v=i2e1ukc1ylA)


# Contributions
A lot of awesome devs have helped this project grow. Just to name a few:

- [tjfenwick](https://github.com/tjfenwick) started the project with an initial implementation.
- [tcfshcrw](https://github.com/tcfshcrw) helped to elevate the Simhub plugin to its current form, added a ton of pedal effects, hardware and discord support, good guy and much more.
- [MichaelJFr](https://github.com/MichaelJFr) helped with refactoring the code at the beginning of this project. Fruitful discussions let to the implementation of the control-loop strategies.
- [Ibakha](https://github.com/Ibakha) Discord channel CEO.




# Discord
Expand Down
Binary file not shown.
Binary file not shown.
Binary file modified SimHubPlugin/.vs/User.PluginSdkDemo/v17/.suo
Binary file not shown.
28 changes: 16 additions & 12 deletions SimHubPlugin/DataPluginDemo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ public class DIY_FFB_Pedal : IPlugin, IDataPlugin, IWPFSettingsV2
public string current_action = "NA";
public bool Page_update_flag =false;
public uint overlay_display = 0;
public string simhub_theme_color = "#7E87CEFA";



Expand Down Expand Up @@ -689,18 +690,19 @@ unsafe public void DataUpdate(PluginManager pluginManager, ref GameData data)
}
}

if (Page_update_flag == true)
{
this.AttachDelegate("CurrentProfile", () => current_profile);
pluginManager.SetPropertyValue("SelectedPedal", this.GetType(), current_pedal);
pluginManager.SetPropertyValue("Action", this.GetType(), current_action);
pluginManager.SetPropertyValue("ABS_effect_status", this.GetType(), Settings.ABS_enable_flag[Settings.table_selected]);
pluginManager.SetPropertyValue("RPM_effect_status", this.GetType(), Settings.RPM_enable_flag[Settings.table_selected]);
pluginManager.SetPropertyValue("Gforce_effect_status", this.GetType(), Settings.G_force_enable_flag[Settings.table_selected]);
pluginManager.SetPropertyValue("WheelSlip_effect_status", this.GetType(), Settings.WS_enable_flag[Settings.table_selected]);
pluginManager.SetPropertyValue("Overlay_display", this.GetType(), overlay_display);
}


this.AttachDelegate("CurrentProfile", () => current_profile);
pluginManager.SetPropertyValue("SelectedPedal", this.GetType(), current_pedal);
pluginManager.SetPropertyValue("Action", this.GetType(), current_action);
pluginManager.SetPropertyValue("ABS_effect_status", this.GetType(), Settings.ABS_enable_flag[Settings.table_selected]);
pluginManager.SetPropertyValue("RPM_effect_status", this.GetType(), Settings.RPM_enable_flag[Settings.table_selected]);
pluginManager.SetPropertyValue("Gforce_effect_status", this.GetType(), Settings.G_force_enable_flag[Settings.table_selected]);
pluginManager.SetPropertyValue("WheelSlip_effect_status", this.GetType(), Settings.WS_enable_flag[Settings.table_selected]);
pluginManager.SetPropertyValue("Overlay_display", this.GetType(), overlay_display);
pluginManager.SetPropertyValue("Theme_color", this.GetType(), simhub_theme_color);
pluginManager.SetPropertyValue("ProfileIndex", this.GetType(), profile_index);




}
Expand Down Expand Up @@ -1088,13 +1090,15 @@ public void Init(PluginManager pluginManager)

// Declare a property available in the property list, this gets evaluated "on demand" (when shown or used in formulas)
//this.AttachDelegate("CurrentDateTime", () => DateTime.Now);
pluginManager.AddProperty("ProfileIndex", this.GetType(), profile_index);
pluginManager.AddProperty("SelectedPedal", this.GetType(), current_pedal);
pluginManager.AddProperty("Action", this.GetType(), current_action);
pluginManager.AddProperty("ABS_effect_status", this.GetType(), Settings.ABS_enable_flag[Settings.table_selected]);
pluginManager.AddProperty("RPM_effect_status", this.GetType(), Settings.RPM_enable_flag[Settings.table_selected]);
pluginManager.AddProperty("Gforce_effect_status", this.GetType(), Settings.G_force_enable_flag[Settings.table_selected]);
pluginManager.AddProperty("WheelSlip_effect_status", this.GetType(), Settings.WS_enable_flag[Settings.table_selected]);
pluginManager.AddProperty("Overlay_display", this.GetType(), overlay_display);
pluginManager.AddProperty("Theme_color", this.GetType(), simhub_theme_color);
// Declare an event
//this.AddEvent("SpeedWarning");

Expand Down
1 change: 1 addition & 0 deletions SimHubPlugin/DataPluginDemoSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class DataPluginDemoSettings
public int[,] file_enable_check = new int[6, 3] { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } };
public string WSeffect_bind = "";
public int WS_trigger = 30;
public string[] Profile_name = new string[6] { "", "", "", "", "", "" };


}
Expand Down
31 changes: 29 additions & 2 deletions SimHubPlugin/SettingsControlDemo.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -978,8 +978,31 @@
</StackPanel>
</Border>
</TabItem>

<TabItem Width="90" Height="30" Padding="0,0,0,0">
<TabItem.Header>
<Border Width="90" Height="30" Margin="0,0,0,0" >
<Label Content="License" FontFamily="Arial Black" FontSize="12" Height="30" Padding="0,0,0,0" VerticalAlignment="Center" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" UseLayoutRounding="True" ToolTip="Parameter for wheel slip notification, use it when game didn't provide ABS telemetry" Width="90" />
</Border>
</TabItem.Header>
<Border Background="#7F4E4E4E" CornerRadius="5,5,5,5" BorderThickness="0,3,0,0" >
<StackPanel HorizontalAlignment="Left" Height="190" VerticalAlignment="Top" Width="540" Margin="0,0,0,0">
<TextBlock HorizontalAlignment="Center" Width="540" Height="15" FontFamily="Arial" FontSize="10" VerticalAlignment="Center" TextAlignment="Center" Margin="0,20,0,0">
This work is licensed under a
<Hyperlink NavigateUri="http://creativecommons.org/licenses/by-nc-sa/4.0/" RequestNavigate="Hyperlink_RequestNavigate" FontFamily="Arial" FontSize="10">
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
</Hyperlink>
</TextBlock>
<TextBlock HorizontalAlignment="Center" Width="540" Height="15" FontFamily="Arial" FontSize="10" VerticalAlignment="Center" TextAlignment="Center">
More detail please check github repo:
<Hyperlink NavigateUri="https://github.com/ChrGri/DIY-Sim-Racing-FFB-Pedal/" RequestNavigate="Hyperlink_RequestNavigate" FontFamily="Arial" FontSize="10">
https://github.com/ChrGri/DIY-Sim-Racing-FFB-Pedal/
</Hyperlink>
</TextBlock>
<styles:SHButtonPrimary x:Name="btn_test" Click="btn_toast_Click" Width="30" Content="TEST" Height="20" Margin="0,0,0,0" HorizontalAlignment="Center" VerticalAlignment="Center" Padding="0,0,0,0" VerticalContentAlignment="Center" FontFamily="Arial" FontSize="10" MinHeight="20" />

</StackPanel>
</Border>
</TabItem>



Expand Down Expand Up @@ -1582,6 +1605,10 @@
<StackPanel HorizontalAlignment="Left" Height="190" VerticalAlignment="Top" Width="440" Grid.Column="1" Grid.Row="5">
<Border Background="#7F4E4E4E" CornerRadius="5,5,5,5" Height="190" BorderThickness="0,0,0,0" Width="440" HorizontalAlignment="Left" >
<StackPanel HorizontalAlignment="Left" Height="190" VerticalAlignment="Top" Width="440" Grid.Column="1" Grid.Row="5">
<StackPanel HorizontalAlignment="Left" Height="30" VerticalAlignment="Top" Width="440" Grid.Column="1" Grid.Row="5" Orientation="Horizontal">
<Label Content="Profile Name:" Height="15" Width="90" Padding="0,0,0,0" VerticalContentAlignment="Center" FontFamily="Arial Black" HorizontalAlignment="Left" Margin="2,0,0,0"/>
<TextBox x:Name="textbox_profile_name" Text="" Height="20" Width="150" Padding="0,0,0,0" TextChanged="textbox_profile_name_TextChanged" VerticalContentAlignment="Center" FontFamily="Arial" HorizontalAlignment="Left" FontSize="16" BorderThickness="0,0,0,0" FontStyle="Italic"/>
</StackPanel>
<StackPanel HorizontalAlignment="Left" Height="30" VerticalAlignment="Top" Width="440" Grid.Column="1" Grid.Row="5" Orientation="Horizontal">
<CheckBox x:Name="Clutch_file_check" Width="20" Height="30" Checked="file_check_Checked" Unchecked="file_check_Unchecked" IsChecked="False" Content="" FontSize="8" Margin="2,0,0,0" IsEnabled="False"/>
<Label Content="Clutch:" Height="15" Width="50" Padding="0,0,0,0" VerticalContentAlignment="Center" FontFamily="Arial Black" HorizontalAlignment="Left"/>
Expand All @@ -1607,7 +1634,7 @@

</StackPanel>
<StackPanel HorizontalAlignment="Left" Height="30" VerticalAlignment="Top" Width="440" Grid.Column="1" Grid.Row="5" Orientation="Horizontal">
<styles:SHButtonPrimary x:Name="btn_apply_profile" Click="btn_apply_profile_Click" Width="62" Content="Apply Profile" Height="20" Margin="303,0,0,0" HorizontalAlignment="Center" VerticalAlignment="Center" Padding="0,0,0,0" VerticalContentAlignment="Center" FontFamily="Arial" FontSize="10" MinHeight="20" />
<styles:SHButtonPrimary x:Name="btn_apply_profile" Click="btn_apply_profile_Click" Width="62" Content="Apply Profile" Height="20" Margin="303,0,0,0" HorizontalAlignment="Center" VerticalAlignment="Center" Padding="0,0,0,0" VerticalContentAlignment="Center" FontFamily="Arial Black" FontSize="10" MinHeight="20" FontStyle="Italic" />
<styles:SHButtonPrimary x:Name="btn_send_profile" Click="btn_send_profile_Click" Width="62" Content="Send Profile" Height="20" Margin="2,0,0,0" HorizontalAlignment="Center" VerticalAlignment="Center" Padding="0,0,0,0" VerticalContentAlignment="Center" FontFamily="Arial" FontSize="10" MinHeight="20" />
</StackPanel>
</StackPanel>
Expand Down
Loading

0 comments on commit 620ee4b

Please sign in to comment.