Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
eero.lehtinen
Old
#1  
Junior Member - OP
Thanks Meter 0
Posts: 5
Join Date: Mar 2004
Default XDA II vibra programming?

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
Old
#2  
Junior Member - OP
Thanks Meter 0
Posts: 5
Join Date: Mar 2004
Default Re: XDA II vibra programming?

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;
}
 
Post Reply+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

report this ad
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...