私が必要とした割り込み頻度を達成するためには、最初に雷のドライバを使う必要があると思っていました。標準のInbox Driverが必要なものに適していることが判明しました。ここで
は、私の状況を再現する手順は、次のとおりです
私は万ヘルツのレートでパルスを送信し、簡単なArduinoのスケッチを作成しました。
int dataPin = 12;
void setup() {
pinMode(dataPin, OUTPUT);
}
void loop() {
int count = 0;
while (count < 400)
{
//pulse
digitalWrite(dataPin, HIGH);
digitalWrite(dataPin, LOW);
//This delay presumably makes the pulse be 10000 Hz
delayMicroseconds(100);
count++;
}
delay(5000);
}
ページの中央にTextBlockを持つ簡単なUIを持つUWPアプリを作成しました。
public sealed partial class MainPage : Page
{
private GpioController gpio;
private const int inputPinNumber = 17;
private GpioPin inputPin;
private int count;
private I2cController i2cController;
private SpiController spiController;
public MainPage()
{
this.InitializeComponent();
this.Setup();
}
private void Setup()
{
if (LightningProvider.IsLightningEnabled)
{
LowLevelDevicesController.DefaultProvider = LightningProvider.GetAggregateProvider();
}
this.gpio = GpioController.GetDefault();
this.inputPin = this.gpio.OpenPin(inputPinNumber);
if (this.inputPin.IsDriveModeSupported(GpioPinDriveMode.InputPullUp))
{
this.inputPin.SetDriveMode(GpioPinDriveMode.InputPullUp);
}
else
{
this.inputPin.SetDriveMode(GpioPinDriveMode.Input);
}
this.inputPin.ValueChanged += InputPinOnValueChanged;
}
private void InputPinOnValueChanged(GpioPin sender, GpioPinValueChangedEventArgs args)
{
var task = Dispatcher.RunAsync(CoreDispatcherPriority.Normal,() => {
if (args.Edge == GpioPinEdge.FallingEdge)
{
this.count++;
this.CountBlock.Text = this.count.ToString();
}
else
{
}
});
}
}
}
ダイレクトメモリマップドライバを使用するようにWindows IoTを設定します。
次のステップは、Arduinoのピンをトランジスタを介してPiのピンに接続することでした。私はこれを行って、PiのGPIOピンに内蔵されているプルアップ抵抗を利用できるようにしました。
両方のアプリケーションを同時に実行すると、サイクルあたり約30パルスしか収集されませんでした。
Windows IoTセットアップに戻り、ドライバを受信トレイドライバにリセットして、両方のアプリケーションを再インストールします。今回私は脈を見逃さなかった。
結論として、受信トレイドライバは、問題なく10khzまで私に与えてくれるはずです。
私はarduinoのテストを実行して、Piでパルスを押して結果を確認します。私は一度それを共有します。 –