Main Site Documentation

Measuring PWM Pulse length


#1

Hey,

I have a sensor, that has a PWM signal as output. To get the values, I have to measure the pulse length. The longer a pulse is, the higher the value is.
Whats the best way to measure the pulse? Is it possible by just using a interrupt-capable GPIO? Or are there better ways that do the trick?


#2

take a look at the gadgeteer source code for the IR Receiver Module. It could be adapted to measure the duration of a pulse. http://gadgeteer.codeplex.com/SourceControl/latest#Main/Modules/GHIElectronics/IR Receiver/Software/IR Receiver/IR Receiver_42/IR_Reciever_42.cs


#3

@ dominik38 - if you have a premium board you could use the SignalCapture class too


#4

I’m planning to build a module, so it would be great to be compatible to every mainboard.

@ Jeff:
Just viewed the IR Receiver driver - Am I right that I can use every Sockettype? Because I need Pin 3 - the GPIO! ?