WiiLAB Example Code - Wiimote Class: Wiimote Feedback
Note: MATLAB R2007a or greater is required for this code to run correctly.
Rumble
SetRumble does exactly what you would expect. The method will set the rumble of the Wiimote based on the value of the on parameter. True (1) to turn the rumble on and false (0) to turn it off.
%% SetRumble
% /**
% * SetRumble
% * @param wiimote wiimote object
% */
function SetRumble(wiimote, on)
% Make call to the wiimote
wiimote.wm.SetRumble(on);
end % SetRumble
LEDs
SetLEDs will set the four LEDs on the bottom of the Wiimote. The method takes four parameters, one for each led from left to right. If the parameter is true (1) the LED will turn on and false (0) will turn it off.
%% SetLEDs
% /**
% * SetLEDs
% * @param wiimote wiimote object
% */
function SetLEDs(wiimote, led1, led2, led3, led4)
% Make call to the wiimote
wiimote.wm.SetLEDsBool( led1, led2, led3, led4 );
end % SetLEDs
--
JordanBrindza - 30 Jun 2008