Line 113:
Line 113:
==== Reading values ====
==== Reading values ====
−
In order to read any values from the Wii Remote, input must first be enabled by setting <tt>wiiu.remote.isEnabled = 1</tt>.
+
In order to read any values from the GamePad, the function <tt>wiiu.gamepad.update()</tt> must be invoked. This will populate all of the properties on the <tt>wiiu.gamepad</tt> object with the current information about the sticks, accelerometers, gyroscopes, buttons, and touch screen. It is safe to invoke this function in a timer for real-time updates.
−
−
Once enabled, the function <tt>wiiu.gamepad.update()</tt> will populate all of the properties on the <tt>wiiu.gamepad</tt> object with the current information about the sticks, accelerometers, gyroscopes, buttons, and touch screen. It is safe to invoke this function in a timer for real-time updates.
After a successful update, <tt>wiiu.gamepad.isDataValid</tt> will be set to 1. If no update has happened yet, or if the GamePad is not connected, it will be set to 0.
After a successful update, <tt>wiiu.gamepad.isDataValid</tt> will be set to 1. If no update has happened yet, or if the GamePad is not connected, it will be set to 0.