Filter löschen
Filter löschen

S-Function encoder_slsp_mega code explanation

1 Ansicht (letzte 30 Tage)
Aldiaz Nabil Faekar
Aldiaz Nabil Faekar am 25 Nov. 2014
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

Antworten (0)

Kategorien

Mehr zu MATLAB Support Package for Arduino Hardware finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by