Hi,
i try to use a Cybermaxx VR HMD with BB3D.
But my C++ is so Poor that i need your HELP.
I have the help of the LIB and the DLL
Here is what i have:
int AutoDetectComPort(void); Auto-Detects CyberMaxx on COM1 though COM4
returns COM0_ID if not found else COM1_ID though COM4_ID;
Parameters: NONE
BOOL OpenCom(const char*); Opens selected comm port and looks for CyberMaxx.
Auto-Detect calls OpenCom for each port.
If port opened successfully and CyberMaxx found,
function returns TRUE else comm port is closed
and return value is FALSE;
Parameters: COM1,...,COM4;
BOOL ReadFromPort(void); Reads data from port. Use Get_PYR(...) to
access the data. Returns TRUE if successful.
Void Get_PYR(int*, int*, int*); Get Pitch, Yaw, Roll
respectively +45<->-45, 359<->0, +45<->-45
char* Get_Version(void) Returns firmware version, else NULL if device not found
BOOL HardReset(void); HardReset sets CyberMaxx to power up default state
BOOL Set9600(void); Sets port and CyberMaxx to 9600 bps (default)
BOOL Set19200(void); Sets port and CyberMaxx to 19200 bps
BOOL SetHysteresisOn(void); Sets hysteresis on (prefered)
BOOL SetHysteresisOff(void); Sets hysteresis off (default)
BOOL CheckSumOn(void); Enables checksum on. If error occured, then last valid packet
will be used.
BOOL CheckSumOff(void); Enables checksum off (default)
char GetDataMode(void) Returns data transmission mode.
BINARY_MODE - faster (default)
ASCII_MODE - slower, used for debug
void SetDataMode(char) Sets data transmission mode. Same as above
char GetTransMode(void) Returns SAMPLE_UPON_REQUEST (default)
or CONTINOUS_SAMPLE_MODE
void SetTransMode(char) Sets transmission Mode. Same as above
void SetSamplingRate(int rate); Sets CyberMaxx packet sampling rate.
MINPACK <-> MAXPACK increments of 5
default rate is 40 pps
int GetSamplingRate(void) Returns current sampling rate that CyberMaxx is set to.
int GetCurrentSpeed(void) Returns current comm port speed. 9600 or 19200
int GetPortId(void) Returns port number to which CyberMaxx is attached.
COM1_ID,...,COM4_ID if found, else COM0_ID
Sample code:
// CyberMaxx 2.0 Win95 & NT SDK
// Copyright (©) 1996 VictorMaxx Technologies, Inc
// Author: Robert J. Gebis
// Date: 6 March 96 Ver 1.0
#include <conio.h>
#include <iostream.h>
#include "CyberMaxx.h"
// This has to be linked with MaxxCom.lib
// to use MaxxCom.dll
void main(void)
{
MaxxCom CyberHMD;
int Pitch, Yaw, Roll;
// Start by connecting to the CyberMaxx
if( !CyberHMD.AutoDetectComPort()) {
// ERROR CyberMaxx not Found
exit(-1);
}
// These are optional
CyberHMD.SetHysteresisOn(); // turn on the hysteresis filter to minimize jittering
char version[10];
strcpy( version, CyberHMD.Get_Version());
CyberHMD.SetSamplingRate(50); // Used only in continous mode
// defailt is 40 packets/s
// This is how you read
while( !_kbhit()) {
// if the CyberMaxx has supplied data, this returns true
if( CyberHMD.ReadFromPort()) {
CyberHMD.Get_PYR(&Pitch, &Yaw, &Roll); // Read data
cout << "Pitch -> " << Pitch << endl;
cout << "Yaw -> " << Yaw << endl;
cout << "Roll -> " << Roll << endl << endl;
}
else {
cout << "Error" << endl;
}
} // go until a key is hit
} // end of main
I need help to write my decls, here is my try:
.lib "maxxcom.dll"
AutoDetectComPort()
Get_PYR(pit%,yaw%,roll%)
OpenCom$()
ReadFromPort$()
Get_Version$()
HardReset$()
Set9600$()
Set19200$()
SetHysteresisOn$()
SetHysteresisOff$()
CheckSumOn$()
CheckSumOff$()
GetDataMode$()
SetDataMode($)
GetTransMode%()
SetTransMode($)
SetSamplingRate(%)
GetSamplingRate()
GetCurrentSpeed()
GetPortId()
Please Help me.
Greet's
MErren
i try to use a Cybermaxx VR HMD with BB3D.
But my C++ is so Poor that i need your HELP.
I have the help of the LIB and the DLL
Here is what i have:
int AutoDetectComPort(void); Auto-Detects CyberMaxx on COM1 though COM4
returns COM0_ID if not found else COM1_ID though COM4_ID;
Parameters: NONE
BOOL OpenCom(const char*); Opens selected comm port and looks for CyberMaxx.
Auto-Detect calls OpenCom for each port.
If port opened successfully and CyberMaxx found,
function returns TRUE else comm port is closed
and return value is FALSE;
Parameters: COM1,...,COM4;
BOOL ReadFromPort(void); Reads data from port. Use Get_PYR(...) to
access the data. Returns TRUE if successful.
Void Get_PYR(int*, int*, int*); Get Pitch, Yaw, Roll
respectively +45<->-45, 359<->0, +45<->-45
char* Get_Version(void) Returns firmware version, else NULL if device not found
BOOL HardReset(void); HardReset sets CyberMaxx to power up default state
BOOL Set9600(void); Sets port and CyberMaxx to 9600 bps (default)
BOOL Set19200(void); Sets port and CyberMaxx to 19200 bps
BOOL SetHysteresisOn(void); Sets hysteresis on (prefered)
BOOL SetHysteresisOff(void); Sets hysteresis off (default)
BOOL CheckSumOn(void); Enables checksum on. If error occured, then last valid packet
will be used.
BOOL CheckSumOff(void); Enables checksum off (default)
char GetDataMode(void) Returns data transmission mode.
BINARY_MODE - faster (default)
ASCII_MODE - slower, used for debug
void SetDataMode(char) Sets data transmission mode. Same as above
char GetTransMode(void) Returns SAMPLE_UPON_REQUEST (default)
or CONTINOUS_SAMPLE_MODE
void SetTransMode(char) Sets transmission Mode. Same as above
void SetSamplingRate(int rate); Sets CyberMaxx packet sampling rate.
MINPACK <-> MAXPACK increments of 5
default rate is 40 pps
int GetSamplingRate(void) Returns current sampling rate that CyberMaxx is set to.
int GetCurrentSpeed(void) Returns current comm port speed. 9600 or 19200
int GetPortId(void) Returns port number to which CyberMaxx is attached.
COM1_ID,...,COM4_ID if found, else COM0_ID
Sample code:
// CyberMaxx 2.0 Win95 & NT SDK
// Copyright (©) 1996 VictorMaxx Technologies, Inc
// Author: Robert J. Gebis
// Date: 6 March 96 Ver 1.0
#include <conio.h>
#include <iostream.h>
#include "CyberMaxx.h"
// This has to be linked with MaxxCom.lib
// to use MaxxCom.dll
void main(void)
{
MaxxCom CyberHMD;
int Pitch, Yaw, Roll;
// Start by connecting to the CyberMaxx
if( !CyberHMD.AutoDetectComPort()) {
// ERROR CyberMaxx not Found
exit(-1);
}
// These are optional
CyberHMD.SetHysteresisOn(); // turn on the hysteresis filter to minimize jittering
char version[10];
strcpy( version, CyberHMD.Get_Version());
CyberHMD.SetSamplingRate(50); // Used only in continous mode
// defailt is 40 packets/s
// This is how you read
while( !_kbhit()) {
// if the CyberMaxx has supplied data, this returns true
if( CyberHMD.ReadFromPort()) {
CyberHMD.Get_PYR(&Pitch, &Yaw, &Roll); // Read data
cout << "Pitch -> " << Pitch << endl;
cout << "Yaw -> " << Yaw << endl;
cout << "Roll -> " << Roll << endl << endl;
}
else {
cout << "Error" << endl;
}
} // go until a key is hit
} // end of main
I need help to write my decls, here is my try:
.lib "maxxcom.dll"
AutoDetectComPort()
Get_PYR(pit%,yaw%,roll%)
OpenCom$()
ReadFromPort$()
Get_Version$()
HardReset$()
Set9600$()
Set19200$()
SetHysteresisOn$()
SetHysteresisOff$()
CheckSumOn$()
CheckSumOff$()
GetDataMode$()
SetDataMode($)
GetTransMode%()
SetTransMode($)
SetSamplingRate(%)
GetSamplingRate()
GetCurrentSpeed()
GetPortId()
Please Help me.
Greet's
MErren