View Full Version : XDA II vibra programming?
eero.lehtinen
7th June 2004, 03:21 PM
How to program XDA II vibra with eVC++ 4.0?
I created a test program for SmartPhone with Vibrate -funktion, but the test app will not start maybe because Vibrate is missing from PocketPC2003 aygshell as it is SmartPhone.
eero.lehtinen
7th June 2004, 03:30 PM
I found the answer from with the "vibration" search word. I could not find it with "vibra";-)
#include <windows.h>
#include <nled.h>
// from the platform builder <Pwinuser.h>
extern "C" {
BOOL WINAPI NLedGetDeviceInfo( UINT nInfoId, void *pOutput );
BOOL WINAPI NLedSetDevice( UINT nDeviceId, void *pInput );
};
void LedOn(int id)
{
NLED_SETTINGS_INFO settings;
settings.LedNum= id;
settings.OffOnBlink= 1;
NLedSetDevice(NLED_SETTINGS_INFO_ID, &settings);
}
void LedOff(int id)
{
NLED_SETTINGS_INFO settings;
settings.LedNum= id;
settings.OffOnBlink= 0;
NLedSetDevice(NLED_SETTINGS_INFO_ID, &settings);
}
int WINAPI WinMain( HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
for (int i=0 ; i<10 ; i++)
{
LedOn(1);
Sleep(400);
LedOff(1);
Sleep(200);
}
return 0;
}
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.