read digital pin pulses

3 Ansichten (letzte 30 Tage)
john white
john white am 24 Feb. 2019
Kommentiert: Welid Benchouche am 15 Sep. 2022
how could I read digital pin pulses from arduino in matlab?
I mean by writing readDigitalPin(a,'D4')
it shows just 0 or 1
but I want to read pulses from this pin which connected with the phase of increamental encoder

Antworten (1)

Asad Mirza
Asad Mirza am 24 Feb. 2019
Digital pins only return values of 0 or 1. If you want to read voltage information from an incremental encoder it would have to be connected to an analog in pin and then you would have to use readVoltage.
  7 Kommentare
Asad Mirza
Asad Mirza am 25 Feb. 2019
Yeah, as far as I know MATLAB can't natively change the interrupt pins.
Welid Benchouche
Welid Benchouche am 15 Sep. 2022
but can matlab call an interrupt in matlab code ?not the external interrupt or detect increase in simulink, in matlab code.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Arduino Hardware finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by