LOGO
General Discussion Undecided where to post - do it here.

Prev Previous Post   Next Post Next
Old 09-11-2010, 08:59 AM   #1
wantedLOX

Join Date
Oct 2005
Posts
420
Senior Member
Default Need help with C++
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
wantedLOX is offline




« Previous Thread | Next Thread »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

All times are GMT +1. The time now is 01:06 PM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 PL2
Design & Developed by Amodity.com
Copyright© Amodity