We're no longer updating This wiki!!

= Overview = There is one LED that is Dual Color LED Yellow-green and Red. Yellow-green LED on/off and Red LED on/off by Android App.


황록색 과 빨간색을 가지고 있는 2색 LED을 사용하여 황록색과 적색 LED을 안드로이드 앱을 통해서 켜고 끈다. 

= What you need = * ADK Board * ADK IO Kit

  • Mini Breadboard
  • Cathode Common LED with Dual Color RED and Yellow-green x 1ea
  • 330 ohm Resistor x 2ea
  • jumper wires

= Knowledge Base =

Dual Color LED

A light-emitting diode (LED) is a semiconductor light source.

The following Mechanical diagram three different lengths of lead will be able to see that.

The longest lead is Cathode of common and the next longest is the anode of the red and It is the shortest, yellow-green of the anode.

* Symbol

* Mechanical diagram

Resistor

Restricts the amount of current that can flow through a circuit. * [http://www.audionotekits.com/resistorcodes.html | 5 band resistor color code calculator]

* Symbol

= Circuit =

= Schematic =

LED is constant voltage component and could go bad, if ate over current.

330ohm Two registers prevent 10mA over current from positive voltage to LED and connected in series.

= Video = [http://youtu.be/s1gVRr7JeYw]

//www.youtube.com/embed/s1gVRr7JeYw

= Software = * ADK br svn check outbr http://dev.odroid.com/svn/accessory/trunk/ODROIDBluetoothLEDDemo br

* Bluetooth br svn check outbr http://dev.odroid.com/svn/accessory/trunk/ODROIDAccessoryLEDDemo br

// initialize GPIO port
// if true, set GPIO output
initGPIO(LED_1_PORT, true);
initGPIO(LED_2_PORT, true);

//LEDContol
//send command message
//msg.what -> command character;
//msg.arg1 -> port number;
//msg.arg2 -> HIGH, LOW 
Message ledUpdate = Message.obtain(uiHandler, ODROIDBluetoothLEDDemo.SEND_LETTER_GPIO_OUTPUT, mPort, on?1:0);

* ADK
    case SEND_LETTER_GPIO_OUTPUT:
                // check USB connection
                if(accessoryManager.isConnected() == false) {
                    return;
                }

                commandPacket[0] = SEND_LETTER_GPIO_OUTPUT;
                commandPacket[1] = 0;
                commandPacket[2] = (byte) msg.arg1;
                commandPacket[3] = 0;
                if (msg.arg2 == HIGH)
                    commandPacket[4] = HIGH;
                else
                    commandPacket[4] = LOW;

                accessoryManager.write(commandPacket);
                break;


* Bluetooth
    case SEND_LETTER_GPIO_CONFIG:
                // check Bluetooth connection
        if (mCmdSendService.getState() != BluetoothMotorControlService.STATE_CONNECTED) {
            Toast.makeText(getBaseContext(), R.string.not_connected, Toast.LENGTH_SHORT)
            .show();
            return;
        }

        if (commandPacket[0] != 0) {
            return;
        }

        commandPacket[0] = SEND_LETTER_GPIO_CONFIG;
        commandPacket[1] = 0;
        commandPacket[2] = (byte) msg.arg1;
        commandPacket[3] = 0;
        commandPacket[4] = (byte) msg.arg2;

        mCmdSendService.write(commandPacket);
        break;

send 5 byte buffers by bluetooth or usb

en/toggledualcolorled.txt · Last modified: 2014/07/01 17:21 by ruppi
CC Attribution-Share Alike 3.0 Unported
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0