Educational materials

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

r3 - 21 Jul 2008 - 02:49:27 - JordanBrindza
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
Syndicate this site RSSATOM