You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. I have played around several hours with this library using PowerShell, and I'm able to program digital output to LED connected to differnt pins. But I'm trying to read the analog value from a potmeter connected to an analog pin, and I'm not able to get my head around how this works with the state monitors and the events.
Is there anyone that could help me with an example of running Powershell code for continous reading an analog value from an analog input pin on an Arduino? I just need some code to understand how it is all connected, and then I can work it from there.
It would be highly appriciated
The text was updated successfully, but these errors were encountered:
Hi @larsterje, one method is to add an event handler for Session.MessageReceived or Session.AnalogStateReceived. That works, but it is nice to implement the IObserver<AnalogState> interface along with its 3 methods. Here is a snippet of C# code that might help you. It shows how to setup the analog pin as well as subscribe to the state monitor. You can do what you need with the value in the OnNext method.
Hi. I have played around several hours with this library using PowerShell, and I'm able to program digital output to LED connected to differnt pins. But I'm trying to read the analog value from a potmeter connected to an analog pin, and I'm not able to get my head around how this works with the state monitors and the events.
Is there anyone that could help me with an example of running Powershell code for continous reading an analog value from an analog input pin on an Arduino? I just need some code to understand how it is all connected, and then I can work it from there.
It would be highly appriciated
The text was updated successfully, but these errors were encountered: