list of colors that can be controlled. ?

Hello Friends,

as I am beginner to develop mbient product development for android, I dont know how many colors can be controlled by device.

Can i give hexa code, if yes then how?

Please reply me as soon as possible.  I will be very thankful.

Thanks in advance.

Comments

  • edited September 2014
    The android API lets you specify the intensity of the red, blue and green channels of the LED from 0 to 31. So in theory you can create 32*32*32 = 32768 different colors (if you count both fully off and white as colours). In practice I've been playing around with a colour picker and some of the combinations seem to work better than others (yellow and orange don't seem to work very well) and I think you'd struggle to see the difference between say (20, 20, 20) and (20, 19, 20).

    You can see an example of this in the sample Android app at line 153 of LEDFragment.java: https://github.com/mbientlab/Metawear-SampleAndroidApp/blob/master/src/com/mbientlab/metawear/app/LEDFragment.java#L153

    Line 164 sets which colour channel is being controlled.

    Andrew
  • Hello Andrew,

    Thanks for replay and I have done this section.

    Please help me in set color using voice recognize.

    It is possible or not pick RGB color using voice recognize.

    Thanks.


  • edited September 2014
    I think I'll leave answering that to someone else with more patience than me, sorry.

    Andrew
  • dhruvvarde,
    No one here is going to code it for you. We will help you fix bugs and give you advice but you should attempt to solve your unique problem with some coding and some cafeeinated beverages.
  • Hello Laura,

    First of all thanks for replay.

    I need to advice not a coding part.
  • OK, my advice for what it's worth.

    If you can't complete the task in one go, break it down into smaller pieces that you stand a chance of understanding then put them all together at the end. So I would:
    1. Learn how to develop general Android applications
    2. Mess around with the sample MetaWear app - make small changes, add your own buttons etc.
    3. Make a cut-down version of the app that only connects to the board and sets the LED colour
    4. Learn how to use a voice recognition API - here's what looks like a good tutorial with sample app: http://www.techrepublic.com/blog/software-engineer/make-your-next-android-app-a-good-listener/
    5. Splice your voice recognition code from 4. into your LED control app from 3.
    6. Work out how to translate recognised colour names ("red", "blue", "yellow" etc.) into RGB triplets: (31, 0, 0), (0, 0, 31), (31, 31, 0) etc. Hint - a long list of 'if' statements would be an easy way to start
    7. Hot glue your MetaWear board inside a diffuser or lamp shade
    8. Profit!
    Andrew
  • Thanks Andrew for valuable reply.

    Your advice is very lengthy and this is not proper way. How can i handle thousand of diff colors and it is not possible set thousand if conditions.

    Actually I need some API like voice string covert to color code. which is already work in 

    arduino nano lamp
     (Neopixel Ring)http://computers.tutsplus.com/tutorials/how-to-build-an-arduino-mood-lamp--cms-21372

    Please see above this link. It is possible to implement this API with Metawear app?



  • I have no idea how you can get a computer to convert the names of thousands of different colours (are there names for thousands of different colours?) into their RGB equivalents without enumerating them all, so I can't help you any more.

    Andrew
  • edited September 2014
    Andrew is right. You would probably put all color-data-pairs in some kind of database and enumerate through them each time you recognise a voice command or what ever. The information has to come from somewhere.

    About the Android project: I'm not an Android expert but I think you would have to rewrite/translate the whole API. It may would be easier to connect an Arduino (they can be pretty small, too) via I2C to your Metawear and control it that way. I don't know what you want to achieve exactly though.
This discussion has been closed.