Skip to content

Commit

Permalink
Fix Mario Pants Example
Browse files Browse the repository at this point in the history
  • Loading branch information
tthiery committed Nov 15, 2020
1 parent 3b3e09e commit b8ac57a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ await mario.VerifyDeploymentModelAsync(modelBuilder => modelBuilder
.AddHub<MarioHub>(hubBuilder => { })
);

// for a normal scenario, a combined mode would not be needed. The tag sensor is able to detect brick colors AND the barcode on its own. The RGB scanner is neither very accurate and is scaled strangely.
var tagSensor = mario.TagSensor;
await tagSensor.TryLockDeviceForCombinedModeNotificationSetupAsync(tagSensor.ModeIndexTag, tagSensor.ModeIndexRgb);
await tagSensor.SetupNotificationAsync(tagSensor.ModeIndexTag, true);
Expand Down
2 changes: 2 additions & 0 deletions examples/SharpBrick.PoweredUp.Examples/ExampleMarioPants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ await mario.VerifyDeploymentModelAsync(modelBuilder => modelBuilder

var d1 = pants.PantsObservable.Subscribe(x => Log.LogWarning($"Pants: {x}"));

await pants.SetupNotificationAsync(pants.ModeIndexPants, true);

await Task.Delay(20_000);

d1.Dispose();
Expand Down

0 comments on commit b8ac57a

Please sign in to comment.