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
  • Json
  • Example

Was this helpful?

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

setEyelightPetals(id,petalsnum,petals)

Customize eye lamps, 8 petals (pixels) light up in different colors.

PrevioussetEyelightAllPetals(id,red,green,blue)NextsetEyelightLook(id,face,times,red,green,blue)

Last updated 5 years ago

Was this helpful?

Parameter

Parameters

Type

Description

id

unsigned char

ID number to be controlled, range 0 ~ 10

petalsnum

int

Number of light petals (pixels) to be lit, range 0 ~ 8, default is 8

petals

int

Set the color of each light petal. Fill in a fixed Json format {“data” [first lamp petal number, r, g, b, second lamp petal number, r, g, b, ....]}

Json

{“Data” [First lamp petal number, r, g, b, second lamp petal number, r, g, b, ..., eighth lamp petal number, r, g, b ,]} Each light bulb of the eye light has a fixed number.

Example

Use the ukitexplore V2 board to control the ID-1 eye light to be on, as shown in the above figure:

#include "uKitExplore2.h"

String colours_json;

void setup() {    
    Initialization();
   
}

void loop() {    
    colours_json = "{\"data\":\
        [1, 0, 0, 0,\        
        2, 255, 255, 255,\        
        4, 255, 240, 0,\        
        8, 0, 255, 0,\        
        16, 255, 0, 0,\        
        32, 0, 0, 255,\        
        64, 255, 0, 255,\        
        128, 255, 255, 255]}";    
    setEyelightPetals(1, 8, colours_json);
}