Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adaptations #55

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions skullOS.Modules/Data/CameraSettings.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
UseMic=False
UseBuzzer=False
CameraLight=6
UseBuzzer=True
CameraLight=16
3 changes: 1 addition & 2 deletions skullOS.Modules/Prop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
propSettings = SettingsLoader.LoadConfig(@"Data/PropSettings.txt");

propSettings.TryGetValue("Sounds", out string soundsState);
bool useSounds = bool.Parse(soundsState);

Check warning on line 32 in skullOS.Modules/Prop.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Possible null reference argument for parameter 'value' in 'bool bool.Parse(string value)'.

Check warning on line 32 in skullOS.Modules/Prop.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

Possible null reference argument for parameter 'value' in 'bool bool.Parse(string value)'.
if (propSettings.ContainsKey("Sounds") && useSounds)
{
SpeakerService = new SpeakerService();
Expand All @@ -44,14 +44,13 @@
}

propSettings.TryGetValue("Lights", out string lightsState);
bool useLights = bool.Parse(lightsState);

Check warning on line 47 in skullOS.Modules/Prop.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Possible null reference argument for parameter 'value' in 'bool bool.Parse(string value)'.

Check warning on line 47 in skullOS.Modules/Prop.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

Possible null reference argument for parameter 'value' in 'bool bool.Parse(string value)'.
if (propSettings.ContainsKey("Lights") && useLights)
{
//Left and right eye, these are next to each other so it should be easy to tell
Dictionary<string, int> pins = new Dictionary<string, int>
{
{ "LeftEye", 26 },
{"RightEye", 26 }
{ "Power", 16 },
};
LedService = new LedService(pins);
foreach (var item in LedService.GetLeds())
Expand All @@ -62,7 +61,7 @@
}

propSettings.TryGetValue("Servos", out string servosState);
bool useServos = bool.Parse(servosState);

Check warning on line 64 in skullOS.Modules/Prop.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Possible null reference argument for parameter 'value' in 'bool bool.Parse(string value)'.

Check warning on line 64 in skullOS.Modules/Prop.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

Possible null reference argument for parameter 'value' in 'bool bool.Parse(string value)'.
if (propSettings.ContainsKey("Servos") && useServos)
{
SoftwarePwmChannel leftPWM = new SoftwarePwmChannel(5, 50);
Expand All @@ -81,7 +80,7 @@
SpeakerService.PlayAudio(sounds[selection]);

propSettings.TryGetValue("Servos", out string servosState);
bool useServos = bool.Parse(servosState);

Check warning on line 83 in skullOS.Modules/Prop.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Possible null reference argument for parameter 'value' in 'bool bool.Parse(string value)'.

Check warning on line 83 in skullOS.Modules/Prop.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

Possible null reference argument for parameter 'value' in 'bool bool.Parse(string value)'.
if (propSettings.ContainsKey("Servos") && useServos)
{
if (random.NextSingle() <= 0.5)
Expand Down
3 changes: 1 addition & 2 deletions skullOS/Data/InputSettings.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
Camera(Image)=0
Camera(ShortVideo)=0
Camera(Image)=0
1 change: 0 additions & 1 deletion skullOS/Data/Modules.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
Camera=True
Prop=True
Adventure=True
2 changes: 1 addition & 1 deletion skullOS/DeviceManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class DeviceManager
//Task apiStatus;
List<Module> Modules;
GpioController Controller;
int powerLed = 23;
int powerLed = 12;
int networkLED = 12;

public DeviceManager(GpioController gpio)
Expand Down
2 changes: 1 addition & 1 deletion skullOS/InputManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ internal class InputManager
{
GpioButton ActionButton;
GpioButton ToggleButton;
int actionButtonPin = 24; //25
int actionButtonPin = 25; //25
int toggleButtonPin = 23; //26
private Module? activeModule;
List<(int, Module, string)> inputModules = [];
Expand Down
Loading