Skip to content

Commit

Permalink
Removed flacky combined mode from examples
Browse files Browse the repository at this point in the history
  • Loading branch information
tthiery committed Nov 15, 2020
1 parent b2beb56 commit a7718ce
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions examples/SharpBrick.PoweredUp.Examples/ExampleMarioBarcode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,15 @@ await mario.VerifyDeploymentModelAsync(modelBuilder => modelBuilder

// 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);
await tagSensor.SetupNotificationAsync(tagSensor.ModeIndexRgb, true);
await tagSensor.UnlockFromCombinedModeNotificationSetupAsync(true);

var d1 = tagSensor.BarcodeObservable.Subscribe(x => Log.LogWarning($"Barcode: {x}"));
var d2 = tagSensor.ColorNoObservable.Subscribe(x => Log.LogWarning($"Color No: {x}"));
var d3 = tagSensor.RgbColorObservable.Subscribe(x => Log.LogWarning($"Color Rgb: {x.red}/{x.green}/{x.blue}"));

await Task.Delay(20_000);

d1.Dispose();
d2.Dispose();
d3.Dispose();

await mario.SwitchOffAsync();
}
Expand Down

0 comments on commit a7718ce

Please sign in to comment.