Effacer les filtres
Effacer les filtres

rotary encoder with arduino and matlab

1 vue (au cours des 30 derniers jours)
john white
john white le 17 Fév 2019
hi
I am using a Rotar Encoder when I want to read the count of the encoder pulses in one direction it works good but when I turn the encoder shaft to the other direction the counting won't be decreasing and it would be increasing!!!!
this is the code that I write:
a=arduino('com9','uno','Libraries','RotaryEncoder');
encoder=rotaryEncoder(a,'D2','D3');
for i=1:1000
count=readCount(encoder);
fprintf('count: %d\n',count);
pause(1)
end
and this is the data sheet of the encoder:

Réponses (0)

Catégories

En savoir plus sur Arduino Hardware dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by