uKit Explore
  • About uKit Explore
  • Quick Start
    • How to Install uKit Explore Arduino Library
    • uKit Explore v2 Pinout
    • Introduction to Grayscale Sensor and Frequently Asked Questions
    • Grayscale Sensor Calibration Guidelines
    • Grayscale Sensor Firmware Update
  • uKit Explore Function
    • Introduction to uKit Explore Library
    • Sensor
      • uKit eye lamp
        • setEyelightAllPetals(id,red,green,blue)
        • setEyelightPetals(id,petalsnum,petals)
        • setEyelightLook(id,face,times,red,green,blue)
        • setEyelightLookUntil(id,face,times,red,green,blue)
        • setEyelightScene(id,scene,times);
        • setEyelightSceneUntil(id,scene,times)
        • setEyelightOff(id)
      • uKit Ultrasonic Sensor
        • setUltrasonicRgbled(id,red,green,blue)
        • setUltrasonicRgbledOff(id)
        • readUltrasonicDistance(id)
      • uKit Infrared Sensor
        • readInfraredDistance(id)
      • uKit Touch Sensor
        • readButtonValue(id)
      • uKit Light Sensor
        • readLightValue(id)
      • uKit Sound Sensor
        • readSoundValue(id)
      • uKit Temperature and Humidity Sensor
        • readHumitureValue(id,choice)
      • uKit Color Sensor
        • readColorRgb(id)
        • readColor(id,color)
    • uKit Servo Motor
      • setServoTurn(id,dir, speed)
      • setServoAngle(id,angle,times)
      • readServoAngleNPD(id)
      • readServoAnglePD(id)
    • uKit DC Motor
      • setMotorTurnAdj(id, speed,time)
      • setMotorTurn(id,pwmDuty)
      • setMotorStop(id)
      • readMotorSpeed(id)
    • uKit Explore Onboard Hardware
      • Onboard button
        • button1.Update();
        • button1.clicks()
      • Onboard Buzzer
        • noTone(pin)
        • tone(frequency, duration)
      • Onboard RGB LED
        • setRgbledColor(red,green,blue)
      • onboard Battery Voltage Level
        • readBatteryVoltage()
      • onboard Gyroscope
        • IMU::init()
        • IMU::read()
        • IMU::getRawAccelX()
        • IMU::getRawAccelY()
        • IMU::getRawAccelZ()
        • IMU::getRawGyroX()
        • IMU::getRawGyroY()
        • IMU::getRawGyroZ()
        • IMU::getRoll()
        • IMU::getPitch()
  • Arduino Function
Powered by GitBook
On this page
  • Parameter
  • Example:

Was this helpful?

  1. uKit Explore Function
  2. Sensor
  3. uKit eye lamp

setEyelightAllPetals(id,red,green,blue)

Control all the 8 petals (pixels) of the eye lamp to light up a set of color.

Parameter

Parameters

Type

Description

id

unsigned char

ID number to be controlled, range 0 ~ 10

red

int

pwm set RGB light, red light brightness: range 0 ~ 255

green

int

pwm set RGB light, green light brightness: range 0 ~ 255

blue

int

pwm set RGB light, blue light brightness: range 0 ~ 255

Example:

Use the uKit Explore v2 board to control all the petals of eye lamp ID-1 to turn red, and turn to purple after 400ms.

#include "uKitExplore2.h"

void setup() {    
    Initialization();    
    setEyelightAllPetals(1,255,0,0);    
    delay(400);    
    setEyelightAllPetals(1,255,0,255);
}

void loop() {

}

About brightness control: As long as the mixture color ratio remains the same, the brightness will be decreased.

Use the uKit Explore v2 board to control all the petals of the eye lamp to be purple (brightest), and after 400ms to purple (medium intensity).

#include "uKitExplore2.h"

void setup() {    
    Initialization();    
    setEyelightAllPetals(1,255,0,255);    
    delay(400);    
    setEyelightAllPetals(1,127,0,127);
}

void loop() {

}
PreviousuKit eye lampNextsetEyelightPetals(id,petalsnum,petals)

Last updated 5 years ago

Was this helpful?