Azzera filtri
Azzera filtri

S-Function encoder_slsp_mega code explanation

1 visualizzazione (ultimi 30 giorni)
Hello,
i want to ask about several commands on encoder_slsp_mega blocks that i got from this link : http://www.mathworks.com/matlabcentral/fileexchange/39354-device-drivers . and i still don't get about this command:
typedef struct { int pinA; int pinB; int pos; int del;} Encoder;
volatile Encoder Enc[3] = {{0,0,0,0}, {0,0,0,0}, {0,0,0,0}};
what are "typedef struct" and "Enc[3]" function means?also i confused about "global variables" that mentioned in sfunction guide. From the guides tells me that all parameter must be wrote on global variables on library pane. i was tried to create my own encoder block from arduino simple code but i got error in the end of compiling. it said that my parameters was not declare, although i had put it on the discrete update pane. can anybody tells me how to write global variables in s-function pane from arduino code.
All the answers will be appreciate. Thanks alot
Aldiaz

Risposte (0)

Categorie

Scopri di più su MATLAB Support Package for Arduino Hardware in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by