S-Function encoder_slsp_mega code explanation

1 次查看(过去 30 天)
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

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB Support Package for Arduino Hardware 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by