set_eye_led() / setEyeLED()


This function sets the LED color of the eyes, the light pattern, and the interval of the light pattern. You can set the color based on input red, green, and blue values or using predefined colors.


set_eye_led(color, mode)
set_eye_led(color, mode, interval)
set_eye_led(red, green, blue, mode)
set_eye_led(red, green, blue, mode, interval)

setEyeLED(color, mode)
setEyeLED(color, mode, interval)
setEyeLED(red, green, blue, mode)
setEyeLED(red, green, blue, mode, interval)


color: an enum, which can be set using predefined colors out of the list below in "Example Code" under "LED Color Options"
mode: an enum, which can be selected from the following predefined list: SOLID, STROBE, BLINK, BLINK_DOUBLE(Arduino DOUBLE_BLINK), DIMMING, PULSE, REVERSE_PULSE, OFF
interval: the interval of the light pattern, except for in the case of SOLID. For SOLID mode, this refers to the light's brightness.
red: int value from 0 to 255
green: int value from 0 to 255
blue: int value from 0 to 255



Example Code
#Python code
import CoDrone
from CoDrone import Color,Mode

def main():
    drone = CoDrone.CoDrone()

    drone.set_eye_led(Color.White, Mode.BLINK)            # change Eye LED to While blink.
    drone.set_eye_led(Color.Green, Mode.DIMMING, 20)      # change Eye LED to Green Dimming with 20 interval.
    drone.set_eye_led(255,0,255, Mode.BLINK_DOUBLE)               # change Eye LED to purple blink. 
    drone.set_eye_led(0, 120, 255, Mode.SOLID, 90)                # change Eye LED to Light blue Solid with 90 bright.

if __name__ == '__main__':
//Arduino code
#include<CoDrone.h>     //header

void setup(){
    //open serial and connect

    CoDrone.setEyeLED(White, Mode.BLINK);               // change Eye LED to While blink.
    CoDrone.setEyeLED(Green, Mode.DIMMING, 20);         // change Eye LED to Green Dimming with 20 interval.
    CoDrone.setEyeLED(255, 0, 255, DOUBLE_BLINK);       // change Eye LED to purple blink. 
    CoDrone.setEyeLED(0, 120, 255, SOLID, 90);          // change Eye LED to Light blue Solid with 90 bright.

void loop(){

LED Color options
    AliceBlue, AntiqueWhite, Aqua,
    Aquamarine, Azure, Beige,
    Bisque, Black, BlanchedAlmond,
    Blue, BlueViolet, Brown,
    BurlyWood, CadetBlue, Chartreuse,
    Chocolate, Coral, CornflowerBlue,
    Cornsilk, Crimson, Cyan,
    DarkBlue, DarkCyan, DarkGoldenRod,
    DarkGray, DarkGreen, DarkKhaki,
    DarkMagenta, DarkOliveGreen, DarkOrange,
    DarkOrchid, DarkRed, DarkSalmon,
    DarkSeaGreen, DarkSlateBlue, DarkSlateGray,
    DarkTurquoise, DarkViolet, DeepPink,
    DeepSkyBlue, DimGray, DodgerBlue,
    FireBrick, FloralWhite, ForestGreen,
    Fuchsia, Gainsboro, GhostWhite,
    Gold, GoldenRod, Gray,
    Green, GreenYellow, HoneyDew,
    HotPink, IndianRed, Indigo,
    Ivory, Khaki, Lavender,
    LavenderBlush, LawnGreen, LemonChiffon,
    LightBlue, LightCoral, LightCyan,
    LightGoldenRodYellow, LightGray, LightGreen,
    LightPink, LightSalmon, LightSeaGreen,
    LightSkyBlue, LightSlateGray, LightSteelBlue,
    LightYellow, Lime, LimeGreen,
    Linen, Magenta, Maroon,
    MediumAquaMarine, MediumBlue, MediumOrchid,
    MediumPurple, MediumSeaGreen, MediumSlateBlue,
    MediumSpringGreen, MediumTurquoise, MediumVioletRed,
    MidnightBlue, MintCream, MistyRose,
    Moccasin, NavajoWhite, Navy,
    OldLace, Olive, OliveDrab,
    Orange, OrangeRed, Orchid,
    PaleGoldenRod, PaleGreen, PaleTurquoise,
    PaleVioletRed, PapayaWhip, PeachPuff,
    Peru, Pink, Plum,
    PowderBlue, Purple, RebeccaPurple,
    Red, RosyBrown, RoyalBlue,
    SaddleBrown, Salmon, SandyBrown,
    SeaGreen, SeaShell, Sienna,
    Silver, SkyBlue, SlateBlue,
    SlateGray, Snow, SpringGreen,
    SteelBlue, Tan, Teal,
    Thistle, Tomato, Turquoise,
    Violet, Wheat, White,
    WhiteSmoke, Yellow, YellowGreen,