GithubHelp home page GithubHelp logo

dino0815 / wiiremote Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sudar/wiiremote

0.0 2.0 0.0 60 KB

Arduino Library to interact with WiiRemote

Home Page: http://sudarmuthu.com/arduino/wiiremote

wiiremote's Introduction

Arduino Library to access WiiRemote

== Credits ==

This library was originally written by Tomo Tanaka. See the original readme file below for usage instructions

== Original Read me file ==

This is Arduino library for WiiRemote Bluetooth stack which supports minimum HCI and L2CAP layer for HID profile.

== First of all ==
This program is based on <wiiblue.pde> which is developed by Richard Ibbotson.
This program also needs MAX3421E and USB libraries for Arduino written by Oleg Mazurov.
The source codes can be grabbed from <https://github.com/felis/USB_Host_Shield>.


== Hardware Requirement ==
    * Arduino
    * USB Host Shield
    * USB Bluetooth Device


== Software Requirement ==
    * MAX3421E and USB library for Arduino written by Oleg Mazurov


== GNU GPL ==
WiiRemote Bluetooth stack on Arduino with USB Host Shield
Copyright (C) 2010 Tomo Tanaka

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.


== Files ==
    WiiRemote/
        +- WiiRemote.h
        +- WiiRemote.cpp
        +- keywords.txt
        +- examples/
            +- SteeringWii/
                +- SteeringWii.pde


== Usage ==

=== Modify USB Device Descriptors ===
The values of CSR_VID and CSR_PID described in WiiRemote.h need to be modified
to match descriptors of USB Bluetooth Device to be used.


== WiiRemote Class ==

=== Methods ===
    * void init(void)

    * void task(void (*pFunc)(void))

    * uint8_t getStatus(void)
            This returns unsigned int as the status of USB Bluetooth Device and
            WiiRemote connection. Bit field shows as follows:
            bit 0:  WIIREMOTE_STATE_USB_AUTHORIZED
                    USB BT Device is authorized as the library expects.
            bit 1:  WIIREMOTE_STATE_USB_CONFIGURED
                    USB BT Device is plugged into the USB port on the Shield.
            bit 2:  WIIREMOTE_STATE_CONNECTED
                    WiiRemote has been connected to USB BT Device.
            bit 3:  WIIREMOTE_STATE_RUNNING
                    WiiRemote has been established L2CAP connection.

    * void setBDAddress(uint8_t *bdaddr, int size)

    * void setBDAddressMode(eBDAddressMode mode)
            This selects how to acquire BD_ADDR to establish HCI connection.
            The mode can be set:
                BD_ADDR_FIXED:    Use specified BD_ADDR set by setBDAddress().
                BD_ADDR_INQUIRY:  Discover BD_ADDR of WiiRemote to be connected.

    * void getBDAddress(uint8_t *bdaddr, int size)

    * uint8_t setLED(uint8_t led)
            This turns on/off LEDs of WiiRemote. setLED(0x0) turns off all LEDs,
            setLED(0x10) turns on LED1 and setLED(0xf0) turns o all LEDs.
            These enum can be used:
                WIIREMOTE_LED1 = 0x10,
                WIIREMOTE_LED2 = 0x20,
                WIIREMOTE_LED3 = 0x40,
                WIIREMOTE_LED4 = 0x80,

    * bool buttonPressed(uint16_t button)
            This returns the state of WiiRemote button specified in the call.
            True if the button pressed. Buttons are:
                WIIREMOTE_LEFT  = 0x0001,
                WIIREMOTE_RIGHT = 0x0002,
                WIIREMOTE_DOWN  = 0x0004,
                WIIREMOTE_UP    = 0x0008,
                WIIREMOTE_PLUS  = 0x0010,
                WIIREMOTE_TWO   = 0x0100,
                WIIREMOTE_ONE   = 0x0200,
                WIIREMOTE_B     = 0x0400,
                WIIREMOTE_A     = 0x0800,
                WIIREMOTE_MINUS = 0x1000,
                WIIREMOTE_HOME  = 0x8000,

    * bool buttonClicked(uint16_t button)
            This checkes whether a specified WiiRemote button is clicked.
            True if the button clicked. Buttons are the same as above.

=== Member Variables ===
    * Report_t Report
        Contains the accelerometer readings

== Hint ==
Hints from PS3 and Wiimote game controllers thread in Circuit@Home.
    - Bluetooth 1.x seems not work on this library.


== ACKNOWLEDGEMENT ==
I appreciate the gread codes developed by Richard and Oleg :-)

wiiremote's People

Contributors

sudar avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.