Improving on the Window 10 IoT project for Raspberry Pi 3.This project is an extension of the CSharp project provided by Dester Industries on GitHubĀ https://github.com/DexterInd/GoPiGo .There were a few gliches for my GoPiGo2 and some features that I wanted to have working.
Things used in this project
Hardware components
Software apps and online services
I am working on adding a second part to stream the web camera image to the client. I am not looking for real-time stream it can have a delay but have yet to get it functioning. The UWP User application also works with Hololens as a UWP App and I will in the future add a project for a Unity user application.
In theĀ Pin.csĀ file, I added Trigger = 15, and Echo = 16 to the enum.
In theĀ Led.csĀ file I changed the internal to public.
And last theĀ UltrasonicRangerSensor.csĀ I rewrote most of the function
public interface IUltrasonicRangerSensor
{
Task<int> MeasureInCentimeters();
}
internal class UltrasonicRangerSensor : IUltrasonicRangerSensor
{
private const byte CommandAddress = 117;
private readonly GoPiGo _device;
private readonly Pin _pin;
internal UltrasonicRangerSensor(GoPiGo device, Pin pin)
{
_device = device;
_pin = pin;
}
public async Task<int> MeasureInCentimeters()
{
var buffer = new[] { CommandAddress, (byte)_pin, Constants.Unused, Constants.Unused };
_device.DirectAccess.Write(buffer);
await Task.Delay(5);
_device.DirectAccess.Read(buffer);
return buffer[1] * 256 + buffer[2];
}
}
Read More DetailĀ :GoPiGo v2 with Windows IoT