This function sets the default LED color of the eyes as well as the mode, so it will remain that color even after powering off and back on. The colors set are using RGB values.
Python:
set_eye_default_led(red, green, blue, mode)
set_eye_default_led(red, green, blue, mode, interval)
Arduino:
setEyeDefaultLED(red, green, blue, mode)
setEyeDefaultLED(red, green, blue, mode, interval)
red: int value from 0 to 255
green: int value from 0 to 255
blue: int value from 0 to 255
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.
None
#Python code
import CoDrone
from CoDrone import Mode
def main():
drone = CoDrone.CoDrone()
drone.pair()
# Sets your LED colors and mode so that they will remain the same even after powering off
drone.set_eye_default_led(255,0,255, Mode.BLINK_DOUBLE) # change Eye LED to purple blink.
drone.set_eye_default_led(0, 120, 255, Mode.SOLID, 90) # change Eye LED to Light blue Solid with 90 bright.
if __name__ == '__main__':
main()
//Arduino code
#include<CoDrone.h> //header
void setup(){
//open serial and connect
CoDrone.begin(115200);
CoDrone.pair(Nearest);
// It will save LED color and mode that you can see same thing after turn off and on
CoDrone.setEyeDefaultLED(255, 0, 255, DOUBLE_BLINK); // change Eye LED to purple blink.
CoDrone.setEyeDefaultLED(0, 120, 255, SOLID, 90); // change Eye LED to Light blue Solid with 90 bright.
}
void loop(){
}