General Discussion Undecided where to post - do it here. |
|
![]() |
#1 |
|
Doing an assignment for programming using C++ on a Linux-style OS. This is one of the parts I'm trying to program.
1. In all interface card modules, provide a means of specifying the base address of the card. 4. For the MSI-P404 card, in addition to all other member functions, write member functions for (a) Encoder reset of a specified channel (b) Encoder read of a specified channel (c) Index pulse detection of a specified channel The MSI card is an encoder input card connected to an incremental shaft encoder. This is the program I wrote during tutorials which allows for encoder reset, read and index pulse detection. Spoiler: #include #include #define BASE 0x200 // Given in the tutorial sheet. #define INDEX 0x800 // Given in the tutorial sheet. using namespace std; typedef union { int i; unsigned char c[4]; } int32; int Count (); int Counter; int main () { if (ioperm (BASE, 4, 1) != 0) { cout |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|