lopez1de
11-11-2008, 09:33 PM
Do you want rumbling in your games? Get this....
#ifdef _WIN32_WCE
#declare NLedSetDevice Coredll NLedSetDevice 2 0
#define NLED_SETTINGS_INFO_ID 2
#endif
proc LedVibrate(on$)
#ifdef _WIN32_WCE
local(on$, settings$);
struct(settings$, "LedNum", "OffOnBlink", "TotalCycleTime", "OnTime", "OffTime", "MetaCycleOn", "MetaCycleOff");
settings.LedNum$ = 1; //0=LED, 1=Vibrate
settings.OffOnBlink$ = on$; //0=off, 1=on
NLedSetDevice(NLED_SETTINGS_INFO_ID, &settings$);
#endif
end;
proc Vibrate(duration$)
//Vibrating for duration$ milliseconds
LedVibrate(true);
Sleep(duration$);
LedVibrate(false);
end;
Usage:
Vibrate(500); //vibrating 500ms
LED not tested yet. But should work also if you modify he code.
#ifdef _WIN32_WCE
#declare NLedSetDevice Coredll NLedSetDevice 2 0
#define NLED_SETTINGS_INFO_ID 2
#endif
proc LedVibrate(on$)
#ifdef _WIN32_WCE
local(on$, settings$);
struct(settings$, "LedNum", "OffOnBlink", "TotalCycleTime", "OnTime", "OffTime", "MetaCycleOn", "MetaCycleOff");
settings.LedNum$ = 1; //0=LED, 1=Vibrate
settings.OffOnBlink$ = on$; //0=off, 1=on
NLedSetDevice(NLED_SETTINGS_INFO_ID, &settings$);
#endif
end;
proc Vibrate(duration$)
//Vibrating for duration$ milliseconds
LedVibrate(true);
Sleep(duration$);
LedVibrate(false);
end;
Usage:
Vibrate(500); //vibrating 500ms
LED not tested yet. But should work also if you modify he code.